MySQL 5.6.19升級(jí)到 5.7.9 的步驟是什么,很多新手對(duì)此不是很清楚,為了幫助大家解決這個(gè)難題,下面小編將為大家詳細(xì)講解,有這方面需求的人可以來學(xué)習(xí)下,希望你能有所收獲。
公司主營業(yè)務(wù):成都網(wǎng)站建設(shè)、做網(wǎng)站、移動(dòng)網(wǎng)站開發(fā)等業(yè)務(wù)。幫助企業(yè)客戶真正實(shí)現(xiàn)互聯(lián)網(wǎng)宣傳,提高企業(yè)的競爭能力。創(chuàng)新互聯(lián)公司是一支青春激揚(yáng)、勤奮敬業(yè)、活力青春激揚(yáng)、勤奮敬業(yè)、活力澎湃、和諧高效的團(tuán)隊(duì)。公司秉承以“開放、自由、嚴(yán)謹(jǐn)、自律”為核心的企業(yè)文化,感謝他們對(duì)我們的高要求,感謝他們從不同領(lǐng)域給我們帶來的挑戰(zhàn),讓我們激情的團(tuán)隊(duì)有機(jī)會(huì)用頭腦與智慧不斷的給客戶帶來驚喜。創(chuàng)新互聯(lián)公司推出巍山免費(fèi)做網(wǎng)站回饋大家。
升級(jí)前版本檢查+測試表創(chuàng)建
[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 ~]#
軟件包:
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安裝命令:
yum install numactl*
yum localinstall --skip-broken mysql-community*
升級(jí)后驗(yàn)證版本和表數(shù)據(jù)
[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 ~]#
注釋:
基本查詢db表沒問題,不過一些mysqldump用到設(shè)計(jì)到系統(tǒng)表時(shí)需要mysql_upgrade做下系統(tǒng)表升級(jí);
升級(jí)前使用mysqldump
[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]#
升級(jí)系統(tǒng)表
[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]#
簡單查詢系統(tǒng)表是否存在:
[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]#
重啟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) ---->這種需要重啟DB才能解決哦~
[root@localhost ~]#
[root@localhost mysql]# /etc/init.d/mysqld restart
停止 mysqld: [確定]
正在啟動(dòng) mysqld: [確定]
[root@localhost mysql]#
再嘗試mysqldump是否成功
[root@localhost mysql]# mysqldump -uroot -p123456 retail_pms BRAND COLOR_INFO SHOP_BRAND ITEM > /root/retail_pms.sql
[root@localhost mysql]#
看完上述內(nèi)容是否對(duì)您有幫助呢?如果還想對(duì)相關(guān)知識(shí)有進(jìn)一步的了解或閱讀更多相關(guān)文章,請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝您對(duì)創(chuàng)新互聯(lián)的支持。