MySQL 8.0 CentOS 7安装手册
MySQL 8.0 CentOS 7安装手册
1简介
MySQL 8.0是自5.7之后的新版本.本文的安装采用在线安装的方式,所以需要服务器或者虚拟机能访问外网.
2准备
2.1安装准备
a) linux版本确认(操作系统是64位),查看方法见下:
cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
getconf LONG_BIT
3 安装
3.1在线安装
a)配置MySQL8.0的安装源.
rpm -Uvh https://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm
b)安装MySQL 8.0社区版服务以及客户端工具.
yum --enablerepo=mysql80-community install mysql-community-server
c)启动Mysql服务.
service mysqld start
d)查看MySQL的状态.
systemctl status mssqld
#或者
service mysqld status
e)查看mysql为root用户生成的临时密码
grep "A temporary password" /var/log/mysqld.log
f)Mysql安装配置,根据提示设置新的密码和密码策略.
mysql_secure_installation
g)Mysql访问端口设置
firewall-cmd --add-port=3306/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-ports
验证:
lsof -i:3306
h)Mysql客户端登录
i)Mysql设置远程用户访问,当然这里也可以创建新的用户.
注:当然这里也可以创建新的用户并授权登录.
mysql> CREATE DATABASE shenl;
mysql> CREATE USER 'usershenl'@'192.168.56.103' IDENTIFIED BY 'Passwd123';
mysql> GRANT ALL ON shenl.* TO 'usershenl'@'192.168.56.103';
mysql> FLUSH PRIVILEGES;
3.3安装验证
a) 测试mysql命令行是否能访问本地的mysql数据库
mysql -uroot -pdWcnfgD=k8=k
select version();
b) 通过Toad for Mysql访问远程的Mysql出现如下问题.
show global variables like 'default_authentication_plugin';
3.4安装问题总结
4 反馈
欢迎有任何疑问反馈给我,以便完善该文档.
5 跟踪
其它验证仍在继续.