mysql-serverインストール

[root@dev ~]# yum -y install mysql-server

 
MySQL設定

[root@dev ~]# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

 
当サイトではold_passwords=1の下に

default-character-set = utf8
query_cache_limit=10M
query_cache_min_res_unit=4k
query_cache_size=24M
query_cache_type=1
key_buffer = 256M
max_allowed_packet =24M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size= 16M
thread_concurrency = 8
join_buffer_size = 131072

を追加しました。
 
MySQL起動

[root@dev ~]# /etc/rc.d/init.d/mysqld start
MySQL データベースを初期化中:  Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h centos.centossrv.com password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com
                                                           [  OK  ]
MySQL を起動中:                                            [  OK  ]

 
MySQL自動起動設定

[root@dev ~]# chkconfig mysqld on

 
MySQL自動起動設定確認&ランレベル2~5のonを確認

[root@centos ~]# chkconfig --list mysqld
mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off