Centos安装MySQL5.7填坑小记
日期:2017-11-21 阅读:3837 分类:学无止境 标签:PHP Mysql LAMP Linux
由于项目需要,Centos6.5环境下的Mysql需要升级到5.7版本,中间遇到的一些坑,做个记录如下;
wget https://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm rpm -Uvh mysql57-community-release-el6-9.noarch.rpm yum install mysql-community-server在yum后报错;
You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest
解决方法如下;
yum clean all rpm --rebuilddb yum update
然后在yum安装MySQL就ok了;
然后改密码,参考http://www.hangthink.com/article/14.html 成功修改密码;
登录MySQL检查密码是否正常登录,可以登录。
然后又出现问题,输入create database blog;提示要重置密码。
You must reset your password using ALTER USER statement before executing this statement.然后重置密码
update user set password=password(“新密码”) where user=”用户名”;又报错
Unknown column 'password' in 'field list'错误的原因是 5.7版本下的mysql数据库下已经没有password这个字段了,password字段改成了authentication_string
然后
update mysql.user set authentication_string=password('blues123') where user='root';依然有报错,密码太简单了不够安全;
错误的原因,有看到说是MySQL5.7后密码设置有新要求,密码中必须至少包含一个大写字母、一个小写字母、一个特殊符号、一个数字,密码长度至少为8个字符。
于是按此要求设置密码,OK;
关于MySQL新密码登录方式以及密码策略,有篇文章总结的很好,参考https://www.cnblogs.com/jonsea/p/5510219.html