安装:
1. wget http://repo.mysql.com/mysql57-community-release-el7-9.noarch.rpm
2. sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm
3. yum check-update
4. yum update
5. yum install mysql mysql-server
6. systemctl start mysqld 启动
更改密码:
查看默认密码 grep 'temporary password' /var/log/mysqld.log
设置新密码
mysql -u root -p
set password for root@localhost = password('1235678!');
使用新密码登录,设置授权
use mysql;
grant all privileges on *.* to root@'%' identified by "12345678!";
flush privileges;
网友评论