centos7 在线安装 mysql8.0
访问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 '1qaz@WSX';
设置允许远程访问:
CREATE USER 'ycroot'@'%' IDENTIFIED BY '1qaz@WSX';
grant all on *.* to 'ycroot'@'%';
ALTER USER 'ycroot'@'%' IDENTIFIED WITH mysql_native_password BY '1qaz@WSX';
FLUSH PRIVILEGES;
接下来就可以用navicat远程连接mysql了
离线安装参考:https://mp.weixin.qq.com/s/ut_SXi6pkbyuaMww5YKMRA