Mysql5.6升级5.7

假设现在已经安装好了5.6并且能正常使用,且在/usr/local/下,mysql是通过软连接指向Mysql5.6的,软连接作用就是方便版本控制。

首先关闭Mysql服务

service mysqld stop

再检查一下/etc/my.cnf中的配置信息datadir,修改为mysql-5.6-------/data.

然后,执行以下命令,解除软连接

cd /usr/local/
unlink mysql 
ln -s mysql-5.7******** mysql
mysql -uroot -p
[root@localhost ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.9 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.7.9     |
+-----------+
1 row in set (0.00 sec)

mysql> 

升级完成,其实只要做个软连接,指定下数据目录就可以了,跨大版本升级的话,在Mysql官网会有相应的操作文档。

猜你喜欢

转载自www.cnblogs.com/shy-1208/p/12153839.html