MySQLのインストール(2/5)
6. データベースの初期化
# vi /etc/my.cnf
:%s/skip-locking/skip-external-locking/g
Esc
:wq
(注)my.cnf の skip-locking を skip-external-locking へ書き換える
# mysql_install_db
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 your-domain.com 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!
7. データベースディレクトリの確認
# cd /var/lib/mysql
# ls -la /var/lib/mysql
合計 23576
drwxr-xr-x 4 mysql mysql 4096 9月 21 12:14 2014 .
drwxr-xr-x 34 root root 4096 9月 21 07:54 2014 ..
-rw-rw---- 1 mysql mysql 5242880 9月 21 09:45 2014 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 9月 21 09:23 2014 ib_logfile1
-rw-rw---- 1 mysql mysql 10485760 9月 21 09:45 2014 ibdata1
drwx------ 2 root root 4096 9月 21 09:40 2014 mysql
-rw-rw---- 1 root root 19734 9月 21 09:40 2014 mysql-bin.000001
-rw-rw---- 1 root root 765307 9月 21 09:40 2014 mysql-bin.000002
-rw-rw---- 1 root root 19734 9月 21 09:52 2014 mysql-bin.000003
-rw-rw---- 1 root root 765307 9月 21 09:52 2014 mysql-bin.000004
-rw-rw---- 1 root root 19734 9月 21 12:06 2014 mysql-bin.000005
-rw-rw---- 1 root root 765307 9月 21 12:06 2014 mysql-bin.000006
-rw-rw---- 1 root root 19734 9月 21 12:14 2014 mysql-bin.000007
-rw-rw---- 1 root root 765307 9月 21 12:14 2014 mysql-bin.000008
-rw-rw---- 1 mysql mysql 152 9月 21 12:14 2014 mysql-bin.index
drwx------ 2 root root 4096 9月 21 08:39 2014 test
-rw-r----- 1 mysql root 3880 9月 21 09:45 2014 your-domain.com.err
*上記 6 で my.cnf の書き換えをしないとエラーになりハマる!
こんな感じ・・・。
# mysql_install_db
Installing MySQL system tables...
140921 12:06:54 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
Filling help tables...
140921 12:06:54 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
・・・・・