1. 下载MySQL Yum 仓库
2. 安装 mysql-community-release-el6-5.noarch.rpm
rpm -ivh mysql-community-release-el6-5.noarch.rpm
3. 停止MySQL
service mysqld stop
4. 更新MySQL
yum update mysql-server.x86_64
5. 启动MySQL
service mysqld start
6. 升级后的问题
6.1 启动失败
6.1.1 报错日志
2014-10-23 22:59:00 3338 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 640 pages (rounded down to MB) than specified in the .cnf file: init ial 768 pages, max 0 (relevant if non-zero) pages! 2014-10-23 22:59:00 3338 [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 her e, 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 th ose 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! 2014-10-23 22:59:00 3338 [ERROR] Plugin 'InnoDB' init function returned error. 2014-10-23 22:59:00 3338 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2014-10-23 22:59:00 3338 [ERROR] Unknown/unsupported storage engine: InnoDB 2014-10-23 22:59:00 3338 [ERROR] Aborting
6.1.2 解决办法, /etc/my.cnf 添加配置
[mysqld] innodb_data_file_path=ibdata1:10M:autoextend
6.2 授权出错: ERROR 2013 (HY000): Lost connection to MySQL server
6.2.1 错误日志
2014-10-23 17:32:57 14289 [ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_host_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_user_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_account_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'host_cache' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'objects_summary_global_by_type' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'setup_actors' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'setup_objects' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'table_io_waits_summary_by_index_usage' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'table_io_waits_summary_by_table' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'table_lock_waits_summary_by_table' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'threads' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_stages_current' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_stages_history' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_stages_history_long' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_thread_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_account_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_user_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_host_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_stages_summary_global_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_statements_current' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_statements_history' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_statements_history_long' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_thread_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_account_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_user_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_host_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_statements_summary_global_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_digest' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'users' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'accounts' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'hosts' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'socket_instances' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'socket_summary_by_instance' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'socket_summary_by_event_name' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'session_connect_attrs' has the wrong structure 2014-10-23 17:32:57 14289 [ERROR] Native table 'performance_schema'.'session_account_connect_attrs' has the wrong structure 2014-10-23 17:32:57 14289 [Note] Event Scheduler: Loaded 0 events
6.2.2 解决办法
# mysql_upgrade