参考文章: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.*"

阿里云CentOS7安装MySql记录

4.安装mysql:shell> yum install mysql-community-server
阿里云CentOS7安装MySql记录

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

阿里云CentOS7安装MySql记录

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

                          shell> systemctl daemon-reload

8.查询当前密码:shell> grep 'temporary password' /var/log/mysqld.log
阿里云CentOS7安装MySql记录

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;

 

相关文章:

  • 2021-09-23
  • 2021-12-10
  • 2021-11-05
  • 2021-01-10
  • 2021-12-08
  • 2018-11-10
  • 2022-01-03
  • 2021-11-29
猜你喜欢
  • 2021-09-14
  • 2021-11-30
  • 2021-11-28
  • 2021-06-18
  • 2021-04-20
  • 2021-09-23
相关资源
相似解决方案