Centos 6 x86安装mysql8.0

Centos 6 x86安装mysql8.0
1. 下载
    wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
2. 本地安装
    yum localinstall mysql80-community-release-el7-1.noarch.rpm -y
3. 查看yum repository是否安装成功
    yum repolist enabled | grep "mysql.*-community.*"
4. rpm -ivh https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
5. 下载mysql server
    yum install mysql-server
6. 启动mysql
    service mysqld start
7. 验证mysql是否启动成功
    netstat -nap|grep 3306
8. 进入mysql(Enter password: 时直接回车)
    mysql -uroot -p
9.修改用户密码
    set password for root@localhost = password('TaoRebecca20180917.install');
10. 解决mysql5.8无法远程连接的问题
    use mysql;
    select host,user from user where user='root'; # 查看host,正常情况,host=localhost
    update user set host='%' where user='root'; #更改host为所有ip
    select host,user from user where user='root'; # 查看更改,此时 host=%
    flush privileges; # 刷新配置


参考地址:
https://blog.csdn.net/m0_37867405/article/details/80281879
https://www.tpyyes.com/a/mysql_oracle/2017/1108/371.html
https://www.cnblogs.com/zhangzhu/archive/2013/08/22/3274831.html

 

你可能感兴趣的:(mysql,centos)