1) 下载
wget http://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.5/MySQL-client- wget http://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.5/MySQL-devel- wget http://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.5/MySQL-server- wget http://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.5/MySQL-shared- |
2) 安装,注意是否要保留原始数据,不保留的话把下面的#去掉
#rm –rf /var/lib/mysql rpm -ivh MySQL-server- rpm -ivh MySQL-shared- rpm -ivh MySQL-devel- rpm -ivh MySQL-client- |
1) 优化mysql
mkdir /var/lib/mysql/ Vi /etc/my.cnf |
把前面的部分修改为:
[client] #password = your_password port = 3306 socket = /var/lib/mysql/mysql.sock default-character-set=utf8 # Here follows entries for some specific programs # The MySQL server [mysqld] character-set-server=utf8 language=/usr/share/mysql/english/ port = 3306 socket = /var/lib/mysql/mysql.sock skip-name-resolve #skip-locking key_buffer = max_allowed_packet = table_cache = 1200 sort_buffer_size = net_buffer_length = 64K read_buffer_size = read_rnd_buffer_size = myisam_sort_buffer_size = query_cache_size= query_cache_limit= thread_cache_size=60 key_buffer_size= table_open_cache=1000 table_cache=1200 thread_cache_size=60 query_cache_size= query_cache_limit= table_definition_cache=1200 myisam_data_pointer_size=7 delayed_queue_size=2000 preload_buffer_size=65536 delayed_queue_size=20 preload_buffer_size=1024 #innodb_read_ahead_threshold=2 innodb_buffer_pool_size= innodb_additional_mem_pool= thread_concurrency = 2 |
2) 启动mysql
Service mysql start |