最近我和伟少正在搭建一个新框架虚拟机使用VirtualBox虚拟系统CentOS7数据库使用MySQL5.7.18这个版本的MySQL和之前的版本安装还有些差异。
这里使用rpm安装从头开始
rpm -qa | grep -i mysql
rpm -e --nodeps mysql
删除干净历史版本下载如下rpm:
mysql-community-client-5.7.18-1.el7.x86_64.rpm
mysql-community-common-5.7.18-1.el7.x86_64.rpm
mysql-community-libs-5.7.18-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.18-1.el7.x86_64.rpm
mysql-community-server-5.7.18-1.el7.x86_64.rpm
libs-common-client-server依次安装注意官方文档给出的配置说明
systemctl start mysqld.service 启动mysql。
错误说明
1.如果遇到如下冲突提示
file /usr/share/mysql/czech/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.44-2.el7.centos.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.44-2.el7.centos.x86_64
file /usr/share/mysql/dutch/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.44-2.el7.centos.x86_64
file /usr/share/mysql/english/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.44-2.el7.centos.x86_64
file /usr/share/mysql/estonian/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.44-2.el7.centos.x86_64
file /usr/share/mysql/french/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from packagemariadb-libs-1:5.5.44-2.el7.centos.x86_64
file /usr/share/mysql/german/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.44-2.el7.centos.x86_64
file /usr/share/mysql/greek/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.44-2.el7.centos.x86_64
file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.44-2.el7.centos.x86_64
请执行yum -y remove mariadb-liv-*,删除多余的package
2.安装完成后启动mysql初始密码在/var/log/mysqld.log
grep temporary password /var/log/mysqld.log
3.初次登陆后MySQL强烈要求修改密码至少包含大写字母小写字母数字特殊字符
ALTER USER rootlocalhost IDENTIFIED BY MyNewPass4!;
4.其他客户端连接MySQL服务器需要添加账号主机信息
create user root192.168.56.1 identified by MysqlClient5.7;
grant all on *.* to root192.168.56.1;
flush privileges;
这样客户端192.168.56.1的主机就可以连接mysql服务器。
喜欢请关注微信公众号码农小麦