CentOS7使用yum安装MySQL8.0

1、yum仓库下载MySQL:sudo yum localinstall https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
2、yum安装MySQL:sudo yum install mysql-community-server
3、启动MySQL服务:sudo service mysqld start
4、检查MySQL服务状态:sudo service mysqld status
5、查看初始密码(如无内容直接跳过):sudo grep ‘temporary password’ /var/log/mysqld.log
6、本地MySQL客户端登录:mysql -uroot -p
7、输入密码为第5步查出的,如果没有,直接回车,然后输入命令 flush privileges
8、修改root登录密码:ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘密码’;
(注意要切换到mysql数据库,使用use mysql)
9、update user set host = ‘%’ where user =‘root’;
允许任何外部可访问
10 Navicat连接MySQL Server8.0版本时出现Client does not support authentication protocol requested by server;
解决如下:
alter user ‘root’@’%’ identified with mysql_native_password by ‘********’;

你可能感兴趣的:(#,关系型数据库,mysql)