Centos 6.8 yum 安装 mysql 错误解决

近日在需要在公司老开发环境安装mysql
于是乎一顿操作

①下载并安装MYSQL官方的 Yum Repository(此处注意版本 centos7以上的版本用的是el7-5 这里是centos6.8 所以使用el6-9)

wget -i -c wget https://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm

rpm -Uvh mysql57-community-release-el6-9.noarch.rpm

②开始安装

yum -y install mysql-community-server

霍霍 报错

--> Finished Dependency Resolution
Error: Package: mysql-community-server-5.7.27-1.el7.x86_64 (mysql57-community)
           Requires: libsasl2.so.3()(64bit)
Error: Package: mysql-community-client-5.7.27-1.el7.x86_64 (mysql57-community)
           Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Error: Package: mysql-community-libs-5.7.27-1.el7.x86_64 (mysql57-community)
           Requires: libc.so.6(GLIBC_2.14)(64bit)
Error: Package: mysql-community-client-5.7.27-1.el7.x86_64 (mysql57-community)
           Requires: libc.so.6(GLIBC_2.14)(64bit)
Error: Package: mysql-community-server-5.7.27-1.el7.x86_64 (mysql57-community)
           Requires: systemd
Error: Package: 2:postfix-2.6.6-6.el6_7.1.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)
           Requires: libmysqlclient.so.16()(64bit)
           Removing: mysql-libs-5.1.73-8.el6_8.x86_64 (installed)
               libmysqlclient.so.16()(64bit)
           Obsoleted By: mysql-community-libs-5.7.27-1.el7.x86_64 (mysql57-community)
               Not found
Error: Package: mysql-community-server-5.7.27-1.el7.x86_64 (mysql57-community)
           Requires: libc.so.6(GLIBC_2.17)(64bit)
Error: Package: mysql-community-server-5.7.27-1.el7.x86_64 (mysql57-community)
           Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

执行

yum clean all

 

继续安装 

成功 

附赠继续安装步骤

 

如果是Centos7.5 安装流程 如下

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server

下载速度过慢解决方案:https://www.cnblogs.com/downmoon/p/11896158.html?spm=a2c6h.13066369.0.0.29f62a995OI4yF

③安装完成 启动MYSQL

systemctl start  mysqld.service

④从日志中找出密码

grep "password" /var/log/mysqld.log

⑤用刚才的密码进入数据库

mysql -uroot -p

 

⑤修改密码,其中new password是新密码

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';

如果提示

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

则是密码策略过高

可以尝试复杂密码或者使用简单策略

set global validate_password_policy=0

⑥开启远程访问

grant all privileges on *.* to 'root'@'192.168.0.1' identified by 'password' with grant option;

 (如开放所有IP 将IP地址换成%)

grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;

 

⑦然后输入下面命令

mysql> flush privileges;

⑧修改为数据库为utf8mb4格式

vim /etc/my.cnf

添加如下代码

[mysqld]

character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
init_connect='SET NAMES utf8mb4'

[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

⑨重新启动mysql

systemctl restart mysqld.service

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值