AKAI TSUKI

System development or Technical something

initialize MySQL 5.6 in CentOS 6.5 after install

インストールした後の続きです。

MySQLを起動します。

# service mysqld start


パスワードを変更するなど言われるので
パスワードを変更います。

# /usr/bin/mysqladmin -u root password 'new-password'

コマンドラインから変更したので

Warning: Using a password on the command line interface can be insecure.

警告がでてきました。

とりあえず、次に進みます。

# /usr/bin/mysql_secure_installation

を実行します。

匿名ユーザの削除など聞かれるので、
いくつかの質問に解答します。

MySQLに接続し、データベースを見てみると以下のようになりました。

# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.6.20 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

mysql>