欢迎光临
感受代码之美

CENTOS 7如何安装mysql8

centos 7上安装mysql 8的过程记录如下:

1.环境信息

  • 服务器版本:CentOS Linux release 7.5.1804 (Core)

2.下载安装文件及必需依赖

下载地址:https://dev.mysql.com/downloads/mysql/8.0.html

需要的安装文件

wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-client-plugins-8.0.25-1.el7.x86_64.rpm

wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-libs-8.0.25-1.el7.x86_64.rpm

wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-client-8.0.25-1.el7.x86_64.rpm

wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-community-server-8.0.25-1.el7.x86_64.rpm

3.执行安装

3.1更新环境信息

sudo yum update

3.2依次执行安装

sudo yum -y install mysql-community-client-plugins-8.0.25-1.el7.x86_64.rpm

sudo yum -y install ./mysql-community-libs-8.0.25-1.el7.x86_64.rpm

sudo yum -y install ./mysql-community-client-8.0.25-1.el7.x86_64.rpm

sudo yum -y install ./mysql-community-server-8.0.25-1.el7.x86_64.rpm

3.3安装成功后密码错误

首次登录提示密码错误:

Enter current password for root (enter for none): 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

解决办法:在安装过程中已为你生成临时密码,使用下面命令查找临时密码。

sudo grep 'temporary password' /var/log/mysqld.log

3.4配置远程连接

CREATE USER 'root'@'%' IDENTIFIED BY 'enter_your_password_here';

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';

参考文章:

  1. https://stackoverflow.com/questions/30334914/access-denied-while-running-mysql-for-the-first-time-on-centos/30335031;
  2. https://stackoverflow.com/questions/50570592/mysql-8-remote-access;
赞(0)
未经允许禁止转载:四个空格 » CENTOS 7如何安装mysql8

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址