[Linux]CentOS6.3にMysqlを導入する

・インストール
# yum install mysql-server

# cd /etc
# cp my.cnf my.cnf.org
# vi my.cnf
# Addition kumakake
[mysqld]
old_passwords=1
#default-character-set=utf8
character-set-server=utf8
skip-character-set-client-handshake

# Addition kumakake
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqldump]
default-character-set=utf8

# chkconfig –list mysqld
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
# chkconfig mysqld on
# chkconfig –list mysqld
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# /etc/rc.d/init.d/mysqld start
MySQL データベースを初期化中: Installing MySQL system tables…
OK
Filling help tables…
OK

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 cent.localdomain password ‘new-password’

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

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 mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

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

[ OK ]
mysqld を起動中: [ OK ]

・データベースの文字コードを確認する
※ダミーでhogeデータベースを作成して確認する
# mysql -u root
mysql> create database hoge;
mysql> use hoge
mysql> show variables like “char%”;

以上です。

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です