标签:rpm 永久 oar 查看 har epo arch shel 命令
sudo wget http://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql57-community-release-el7-10.noarch.rpm
sudo rpm -ivh mysql57-community-release-el7-10.noarch.rpm
sudo yum -y install mysql-community-server
这一步比较耗时
sudo systemctl start mysqld
sudo systemctl enable mysqld
在/var/log/mysqld.log文件中找到初始密码
cat /var/log/mysqld.log
此处初始密码为:%wwkmFXYt2NA
sudo mysql -uroot -p
输入初始密码:%wwkmFXYt2NA
ALTER USER 'root'@'localhost' IDENTIFIED BY 'L2019Mysql@';
密码强度默认规则为(长度最少8位,包含大小写字母、数字、特殊字符)
如果想要设置简单密码,可修改密码强度,可参考:https://blog.csdn.net/u014236541/article/details/78244601
1.执行授权命令
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'L2019Mysql@' WITH GRANT OPTION;
2.退出mysql操作控制台
exit
3.开放3306端口
开启防火墙
sudo systemctl start firewalld.service
永久开放3306端口
sudo firewall-cmd --add-port=3306/tcp --permanent
重新加载
sudo firewall-cmd --reload
关闭防火墙
sudo systemctl stop firewalld.service
查看修改前mysql编码
show variables like '%chara%';
修改/etc/my.cnf文件,加入下面两行
sudo vim /etc/my.cnf
character_set_server=utf8
init_connect='SET NAMES utf8'
修改后,重启mysql
sudo systemctl restart mysqld
查看修改后的mysql编码
使用navicat连接mysql
标签:rpm 永久 oar 查看 har epo arch shel 命令
原文地址:https://www.cnblogs.com/zuidongfeng/p/10245846.html