我是靠谱客的博主 野性金毛,最近开发中收集的这篇文章主要介绍mysql+procud_mysql升级(物理升级),觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

mysql升级是经常要做的工作,整理下升级步骤(物理升级)

1,关闭mysql服务

2,高版本软件覆盖低版本软件(替换掉basedir)

3,赋予新的高版本软件mysql权限

4,使用新的软件开启数据库

5,执行mysql_upgrade升级

实验:

5.6.23升级到5.7.12

1,关闭正在运行的mysql5.6.23的服务

2,删除低版本的mysql软件(basedir)

[root@mysqlupgrade mysql]# rm -rf mysql/

3,解压高版本的mysql软件包,覆盖到原来的位置

[root@mysqlupgrade soft]# tar xzvf mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz -C /data/mysql/

[root@mysqlupgrade mysql]# mv mysql-5.7.12-linux-glibc2.5-x86_64 mysql

4,赋予权限

[root@mysqlupgrade mysql]# chown -R mysql:mysql mysql/

5,开启数据库

[root@mysqlupgrade mysql]# bin/mysqld_safe --ledir=/data/mysql/mysql/bin --user=mysql &

6,进入数据库,查看当前版本

mysql> select version();

+-----------+

| version() |

+-----------+

| 5.7.12    |

+-----------+

1 row in set (0.00 sec)

6,mysql_upgrade升级

[root@mysqlupgrade mysql]# bin/mysql_upgrade  -udbauser -p123456 -h192.168.56.99 -P3306

mysql_upgrade: [Warning] Using a password on the command line interface can be insecure.

Checking if update is needed.

Checking server version.

Running queries to upgrade MySQL server.

Checking system database.

mysql.columns_priv                                 OK

mysql.db                                           OK

mysql.engine_cost                                  OK

mysql.event                                        OK

mysql.func                                         OK

mysql.general_log                                  OK

mysql.gtid_executed                                OK

mysql.help_category                                OK

mysql.help_keyword                                 OK

mysql.help_relation                                OK

mysql.help_topic                                   OK

mysql.innodb_index_stats                           OK

mysql.innodb_table_stats                           OK

mysql.ndb_binlog_index                             OK

mysql.plugin                                       OK

mysql.proc                                         OK

mysql.procs_priv                                   OK

mysql.proxies_priv                                 OK

mysql.server_cost                                  OK

mysql.servers                                      OK

mysql.slave_master_info                            OK

mysql.slave_relay_log_info                         OK

mysql.slave_worker_info                            OK

mysql.slow_log                                     OK

mysql.tables_priv                                  OK

mysql.time_zone                                    OK

mysql.time_zone_leap_second                        OK

mysql.time_zone_name                               OK

mysql.time_zone_transition                         OK

mysql.time_zone_transition_type                    OK

mysql.user                                         OK

Upgrading the sys schema.

Checking databases.

sys.sys_config                                     OK

Upgrade process completed successfully.

Checking if update is needed.

[root@mysqlupgrade mysql]#

备注:

升级的时候报错

[root@mysqlupgrade mysql]# /data/mysql/mysql/bin/mysql_upgrade -udbauser -p123456

Warning: Using a password on the command line interface can be insecure.

Looking for 'mysql' as: /data/mysql/mysql/bin/mysql

Looking for 'mysqlcheck' as: /data/mysql/mysql/bin/mysqlcheck

Error: Failed while fetching Server version! Could be due to unauthorized access.

FATAL ERROR: Upgrade failed

mysql -udbauser -p123abc456 -h192.168.56.99 -P3306

测试下这样 是否可以连上,必须要能连上才可以。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31447263/viewspace-2145333/,如需转载,请注明出处,否则将追究法律责任。

最后

以上就是野性金毛为你收集整理的mysql+procud_mysql升级(物理升级)的全部内容,希望文章能够帮你解决mysql+procud_mysql升级(物理升级)所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(67)

评论列表共有 0 条评论

立即
投稿
返回
顶部