CentOS 6.x使用yum快速安裝MySQL 5.5

來源:互聯網
上載者:User

MySQL 5.5系列成為穩定版已經有一段時間了,但據我調查瞭解,在生產環境中還是以5.1系列為主。在國內的大公司裡,只確定金山在使用5.5了。
 之前一直用內建安裝的MySQL 5.1系列,使用了innodb儲存引擎,偶發現5.1對innodb引擎支援不怎麼好,資料庫並發串連數多時會出現丟串連,於是就想升級到5.5試試。因已安裝了5.0,所以不想編譯安裝了。就直接找了一個國外編譯好的5.5的yum源,直接升級,跑了一個月了,發現很穩定!就分享一下:
 
1、安裝MySQL 5.5.x的yum源:
 rpm -Uvh http://repo.webtatic.com/yum/CentOS/5/latest.rpm
 
2、安裝MySQL用戶端的支援包:
 yum install libmysqlclient15 --enablerepo=webtatic
 
3、卸載MySQL老版本的軟體包:
 yum remove mysql mysql-*
 
4、安裝MySQL 5.5的用戶端和服務端:
 yum install mysql55 mysql55-server --enablerepo=webtatic  //--enablerepo=webtatic 指定使用我們第一步下載的yum源進行下載安裝
 
5、啟動MySQL系統服務,更新資料庫:
 
/etc/init.d/mysqld restart
 mysql_upgrade
 
6、附:此台伺服器的my.cnf配置
 
skip-locking
 skip-name-resolve
 key_buffer = 1024M
 back_log = 3000
 max_allowed_packet = 4M
 table_cache = 512
 sort_buffer_size = 8M
 read_buffer_size = 8M
 myisam_sort_buffer_size = 1024M
 thread_cache = 512
 query_cache_size = 512M
 set-variable = wait_timeout=60
 thread_concurrency = 4
 log-slow-queries = slow.log
 long_query_time = 1
 innodb_flush_log_at_trx_commit = 2
 innodb_buffer_pool_size = 1024M
 #innodb_locks_unsafe_for_binlog = 1
 如果不是升級,而是新安裝。還需要設定root密碼,刪除預設的空使用者、空密碼等等.........

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.