访问https://dev.mysql.com/downloads/repo/yum/上的MySQL Yum存储库下载页面 。
选择并下载适用于您的平台的发行包。
使用以下命令安装下载的发行包,替换 platform-and-version-specific-package-name 为下载的包的名称:
shell> sudo rpm -Uvh platform-and-version-specific-package-name.rpm
shell> yum repolist all | grep mysql
shell> sudo yum install mysql-community-server
shell> systemctl start mysqld.service
//初始化密码
shell> sudo grep ‘temporary password‘ /var/log/mysqld.log
//用上面初始化的密码登录,并修改密码
shell> mysql -uroot -p
//修改密码
mysql> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘[email protected]‘;
设置允许远程访问:
CREATE USER ‘ycroot‘@‘%‘ IDENTIFIED BY ‘[email protected]‘;
grant all on *.* to ‘ycroot‘@‘%‘;
ALTER USER ‘ycroot‘@‘%‘ IDENTIFIED WITH mysql_native_password BY ‘[email protected]‘;
FLUSH PRIVILEGES;
接下来就可以用navicat远程连接mysql了
原文地址:https://www.cnblogs.com/hanpengblog/p/10807813.html