Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the steps to upgrade from MySQL 5.6.19 to 5.7.9

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

MySQL 5.6.19 upgrade to 5.7.9 what is the step, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

Pre-upgrade version check + test table creation

[root@localhost] # mysql-uroot-p123456-- socket=/var/lib/mysql/mysql3307.sock-- port=3307-e "create database lottery; use lottery;create table lottery.mhq as select 'test';select version ();"

+-+

| | version () |

+-+

| | 5.6.19-log |

+-+

[root@localhost ~] #

Software package:

Wget http://downloads.mysql.com/archives/get/file/mysql-community-client-5.7.9-1.el6.x86_64.rpm

Wget http://downloads.mysql.com/archives/get/file/mysql-community-server-5.7.9-1.el6.x86_64.rpm

Wget http://downloads.mysql.com/archives/get/file/mysql-community-common-5.7.9-1.el6.x86_64.rpm

Wget http://downloads.mysql.com/archives/get/file/mysql-community-libs-5.7.9-1.el6.x86_64.rpm

Yum installation commands:

Yum install numactl*

Yum localinstall-skip-broken mysql-community*

Verify version and table data after upgrade

[root@localhost] # mysql-uroot-p123456-- socket=/var/lib/mysql/mysql3307.sock-- port=3307-EN-e "select version (); select * from lottery.mhq;"

* * 1. Row *

5.7.9-log

* * 1. Row *

Test

[root@localhost ~] #

Note:

The basic query db table is fine, but some mysqldump needs to upgrade the system table when designing it to the system table.

Use mysqldump before upgrading

[root@localhost mysql] # mysqldump-uroot-p123456-B retail_pms > / root/retail_pms.sql

Mysqldump: Couldn't execute 'SHOW VARIABLES LIKE' gtid\ _ mode'': Native table 'performance_schema'.'session_variables' has the wrong structure (1682)

[root@localhost mysql] #

Upgrade system tabl

[root@localhost mysql] # mysql_upgrade-u root-p123456-- socket=/var/lib/mysql/mysql3307.sock-- port=3307-- force

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

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.

Lottery.mhq OK

Sys.sys_config OK

Upgrade process completed successfully.

Checking if update is needed.

[root@localhost mysql] #

Simply query whether the system table exists:

[root@localhost mysql] # find /-name session_variables*

/ var/lib/mysql/performance_schema/session_variables.frm

/ data/wonhigh/mysql3307/performance_schema/session_variables.frm

[root@localhost mysql] #

Restart DB

[root@localhost] # date;mysqldump-uroot-pW@h2Gh#2ol5-A-- single-transaction-Q-R-- set-gtid-purged=OFF > / data/all.sql;date

Mysqldump: Couldn't execute 'SHOW VARIABLES LIKE' ndbinfo\ _ version'': Native table 'performance_schema'.'session_variables' has the wrong structure (1682)-> this needs to be solved by restarting DB.

[root@localhost ~] #

[root@localhost mysql] # / etc/init.d/mysqld restart

Stop mysqld: [OK]

Starting mysqld: [OK]

[root@localhost mysql] #

Try again whether mysqldump is successful or not

[root@localhost mysql] # mysqldump-uroot-p123456 retail_pms BRAND COLOR_INFO SHOP_BRAND ITEM > / root/retail_pms.sql

[root@localhost mysql] #

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report