MySQLにてユーザ作成

まずはMySQLのrootユーザのパスワードを設定する

# mysqladmin -u root password password

設定したrootユーザでMySQLにログインし、
パスワードの設定されていないゲストユーザを削除する。

その後、アプリケーション用ユーザを作成する。

# mysql -u root -p
Enter password: (設定したパスワード)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.0.45 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql;

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> delete from user where password='';
Query OK, 2 rows affected (0.40 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> grant select,insert,delete,update,create,drop,file,alter,index on *.* to (ユーザ名)@localhost identified by '(パスワード)';
Query OK, 0 rows affected (0.00 sec)