精简安装centos7.4 后安装MySQL会出现的问题

mac2024-04-09  26

安装MySQL RPM 的安装包 ,执行RPM-ivh 命令时如果有    

file /usr/share/mysql/czech/errmsg.sys from install of mysql-community-common-5.7.28-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64 file /usr/share/mysql/danish/errmsg.sys from install of mysql-community-common-5.7.28-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64

则表示要卸载mariadb-libs-1:5.5.56-2.el7.x86_64文件(命令rpm -e mysql-libs-5.1.66-2.el6_3.i686 --nodeps)

然后继续安装mysql-common-(多个文件),

安装完成后执行grep "password" /var/log/mysqld.log //前往日志文件查找临时密码 ,

mysql -uroot-p 用临时密码登录,

登录成功后执行命令:alter user 'root'@'localhost' identified by '(你的密码)';修改密码,

执行flush privileges;保存

exit退出MySQL。

修改MySQL端口,修改/etc/my.cnf 配置文件,添加port=3308 保存并退出,执行命令service mysqld restart 如果启动失败,会提示

Redirecting to /bin/systemctl restart mysqld.service Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

执行命令journalctl -xe查看日志,如果日志中有标红为SELinux is preventing /usr/sbin/mysqld的内容

查看博客:https://www.iteye.com/blog/jejoker-1882028 修改SELinux安全配置文件,

重新运行service mysqld restart ,启动成功。

重新进入MySQL ,mysql> show global variables like 'port';查看端口是否修改成功

 

最新回复(0)