日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

yum mysql 5.1 innodb_Yum升级mysql5.1到5.6

發布時間:2023/12/10 数据库 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 yum mysql 5.1 innodb_Yum升级mysql5.1到5.6 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Yum升級mysql5.1到5.6

有一些虛擬機、云主機提供商仍然使用的是老版本的安裝套件。預裝的應用軟件版本很低。

比如?techbrood.com?使用的云服務器,其中MySQL預裝版本為老版本5.1.x。而最新的mysql版本在性能、功能、安全性等方面都有了很多的改進。

要從最新版本獲益,你需要把現有系統升級到5.5+(最新的版本是5.7),我保守一點,升級到5.6.37。

有相關測試數據說明從5.1到5.5+,MySQL性能會有明顯的提升,具體的需要自己建立測試環境去實踐下。

首先更新rpm

從MySQL Yum倉庫下載最新的rpm文件:http://dev.mysql.com/downloads/repo/yum/

(需要Oracle帳號以及填寫一些使用信息,才能進入下載頁面)

我需要下載的是:mysql-community-release-el6-5.noarch.rpm

安裝這個發布包

yum localinstall mysql-community-release-el6-5.noarch.rpm

可以通過下面的命令來確認這個倉庫被成功添加:

yum repolist enabled | grep "mysql.-community.

安裝MySQL服務器

yum install mysql-community-server

新版本的目標文件是/usr/bin/mysql,如果原預裝路徑在/bin下面,則需要進行替換,最好是使用軟鏈接,比如ln -s /usr/bin/mysql /bin/

這樣在需要的時候,可以方便的在不同版本之間進行切換。(有時候需要版本回退來定位問題)

重啟服務器就可以了

service mysqld restart

確認版本信息:

[root@west195246 bin]# mysql -V

mysql ?Ver 14.14 Distrib 5.6.20, for?Linux?(x86_64) using ?EditLine wrapper

在我進行過的幾次軟件升級之后,總會在 MySQL 的日志中見到“[ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it”之類的錯誤。雖然這個錯誤修復起來很簡單,卻不容易引起注意。可以按如下方法修復:

錯誤日志如下:

[ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 640 pages (rounded down to MB) than specified in the .cnf file: initial 16384 pages, max 0 (relevant if non-zero) pages!

2017-09-01 09:15:06 5588 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!

2017-09-01 09:15:06 5588 [ERROR] Plugin 'InnoDB' init function returned error.

2017-09-01 09:15:06 5588 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2017-09-01 09:15:06 5588 [ERROR] Unknown/unsupported storage engine: InnoDB

2017-09-01 09:15:06 5588 [ERROR] Aborting

錯誤提示如下:

[ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it

[ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure

[ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure

[ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure

[ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure

[ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure

[ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure

[ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure

[ERROR] Native table 'performance_schema'.'threads' has the wrong structure

[ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure

[ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure

[ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure

[ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure

[ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure

[ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure

[ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure

[ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure

[ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure

[Note] Event Scheduler: Loaded 0 events

[Note] /usr/libexec/mysqld: ready for connections.

Version: '5.5.20-log'? socket: '/var/lib/mysql/mysql.sock'? port: 0

處理方法:

#cd /var/lib/mysql

#rm -rf ib*

#service mysqld restart

需要按照如下的格式在 Linux 的 —— 而不是 MySQL 的 —— 命令提示符下運行:

#mysql_upgrade -u root -p

然后根據提示輸入 mysql 的 root 帳戶密碼,修復過程就可自動運行。此時會有如下形式的提示信息輸出:

mysql_upgrade -u root -p

Enter password:

Looking for 'mysql' as: mysql

Looking for 'mysqlcheck' as: mysqlcheck

Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/lib/mysql/mysql.sock'

Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/lib/mysql/mysql.sock'

wp_commentmeta??????????????????? ???????????OK

wp_comments????????????????????????????????? OK

wp_links???????????????????????????????????? OK

wp_options?????????????????????????????????? OK

wp_postmeta????????????????????????????????? OK

wp_posts???????????????????????????????????? OK

wp_term_relationships??????????????????????? OK

wp_term_taxonomy???????????????????????????? OK

wp_terms???????????????????????????????????? OK

wp_usermeta????????????????????????????????? OK

wp_users???????????????????????????????????? OK

mysql.columns_priv???????????????????????????????? OK

mysql.db?????????????????????????????????????????? OK

mysql.event??????????????????????????????????????? OK

mysql.func???????????????????????????????????????? OK

mysql.general_log????????????????????????????????? OK

mysql.help_category??????????????????????????????? OK

mysql.help_keyword????????????????????????????????OK

mysql.help_relation??????????????????????????????? OK

mysql.help_topic????????????????????????????????? OK

mysql.host???????????????????????????????????????? OK

mysql.ndb_binlog_index???????????????????????????? OK

mysql.plugin??????????????????????? ???????????????OK

mysql.proc???????????????????????????????????????? OK

mysql.procs_priv?????????????????????????????????? OK

mysql.servers???????????????????????????????????? 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

Running 'mysql_fix_privilege_tables'... OK

##service mysqld restart

總結

以上是生活随笔為你收集整理的yum mysql 5.1 innodb_Yum升级mysql5.1到5.6的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。