mysql5.6升级5.7.21
1. 停止mysql5.6
systemctl stop mysqld
2. 先下载mysql5.7
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
3. 安装 mysql57-community-release-el7-11.noarch.rpm
sudo rpm -Uvh mysql57-community-release-el7-11.noarch.rpm
4. 查看可以被安装的mysql列表
yum repolist all | grep mysql
5. 更新mysql
sudo yum update mysql-server -y
6. 登录时有可能报这样的错:ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2),
sudo chown -R openscanner:openscanner /var/lib/mysql
然后,重启服务:
service mysqld restart
7. 注意事项
原先的root账号密码无需更改,原先的数据库会自动导入到mysql5.7中,
MySQL内置了ngram全文检索插件,用来支持中文分词,并且对MyISAM和InnoDB引擎有效。