阿里云CentOS7安装MySql记录

参考文章:https://blog.csdn.net/xyang81/article/details/51759200

1.下载mysql源安装包 shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

2.安装mysql源 shell> yum localinstall mysql57-community-release-el7-8.noarch.rpm

3.检查是否安装成功:shell> yum repolist enabled | grep "mysql.*-community.*"

4.安装mysql:shell> yum install mysql-community-server

5:启动mysql:shell> systemctl start mysqld
6:查看启动状态:shell> systemctl status mysqld

7.设置开机启动:shell> systemctl enable mysqld

                          shell> systemctl daemon-reload

8.查询当前密码:shell> grep 'temporary password' /var/log/mysqld.log

9.root登录:shell> mysql -uroot -p (登录密码为截图红色框位置,其中l6和16很像,一直登录错误)

10.修改密码:ALTER USER 'root'@'localhost' IDENTIFIED BY '你的密码';

11.添加远程登录用户:GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;

猜你喜欢

转载自blog.csdn.net/weixin_39270764/article/details/81170503