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

安装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
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值