Centos6.xにMySQLをインストールする方法

1.インストール
#yum install mysql-server
#cp /etc/my.cnf /etc/my.cnf.org

2.修正ファイル
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

character_set_server=utf8
default-storage-engine=InnoDB
innodb_file_per_table
[mysql]
default-character-set=utf8
[mysqldump]
default-character-set=utf8

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

3.再起動
#service mysqld start

4.パスワードの設定
#mysql_secure_installation
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

自動起動の設定
#chkconfig mysqld on

Linux

Posted by arkgame