MySQLの設定をした件について

インストールの次は設定。ますは、MySQLの初期が必要らしい。

$ sudo -u mysql mysql_install_db5

パスワードを要求されるので入力すると、またまた大量のメッセージが表示される。

Installing MySQL system tables...
090419 17:11:45 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
090419 17:11:45 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
090419 17:11:45 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/db/mysql5/ is case insensitive
OK
Filling help tables...
090419 17:11:45 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
090419 17:11:45 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
090419 17:11:45 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/db/mysql5/ is case insensitive
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:
/opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-password'
/opt/local/lib/mysql5/bin/mysqladmin -u root -h VISNU.local password 'new-password'

Alternatively you can run:
/opt/local/lib/mysql5/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 /opt/local ; /opt/local/lib/mysql5/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /opt/local/lib/mysql5/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

大丈夫なのかな。この段階では、まだMySQLが動いていないので、MySQLを起動する。

$ sudo /opt/local/share/mysql5/mysql/mysql.server start

パスワードを要求されるので入力すると、↓のようなメッセージが。

Starting MySQL
. SUCCESS!

これで起動しているということかな。安心安心。次はrootのパスワード設定だ。

$ /opt/local/lib/mysql5/bin/mysqladmin -u root password 'passwd'

'passwd'の部分は、お好きなパスワードをどうぞってこと。ちなみに、「'」は不要みたいだ。

次にデータベースの作成。

mysql> create database データベース名;
Query OK, 1 row affected (0.00 sec)

mysql> grant all on wp_uss1701.* to ユーザ名@localhost identified by 'パスワード';
Query OK, 0 rows affected (0.00 sec)

赤くなっているところは、それぞれの環境に応じて決めれば良いみたい。なお、こちらでは「'」は必要だった。省略したら、syntax errorでおこられてしまった。
ということで、MySQLの設定は、とりあえずここまで。