アットウィキロゴ

自動起動設定

cp /home/webadmin/src/mysql-6.0.6-alpha/support-files/mysql.server /etc/rc.d/init.d/mysql
chmod 755 /etc/rc.d/init.d/mysql
chkconfig --add mysql


ポート開放

/sbin/iptables -I INPUT -p tcp -m tcp --dport 3306 --syn -j ACCEPT


Mysql用スーパーユーザーの設定

今回はrootユーザーにパスワード"mysql"を設定しています。

html2 plugin Error : このプラグインで利用できない命令または文字列が入っています。

データベース

データベース"testdb"を作成しました

$ mysql -u root -p
Enter password: ????
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 6.0.6-alpha Source distribution

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

mysql> create database testdb;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema | 
| mysql              | 
| test               | 
| testdb             | 
+--------------------+
4 rows in set (0.10 sec)

mysql> quit 

ユーザーの作成

"root"ユーザーと"testuser"ユーザーを全てのIPから参照できるように対応

$ mysql -u root -p
Enter password: ????
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 6.0.6-alpha Source distribution

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

mysql> grant all privileges on *.* to root@'%' identified by '????';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on *.* to testuser@'%' identified by '????';
Query OK, 0 rows affected (0.00 sec)

mysql> quit 

※identified by '????';はパスワードを指定する

テスト接続

$ mysql -u testuser -h 192.168.10.141 -p
Enter password:???? 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 6.0.6-alpha Source distribution

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

mysql> quit
最終更新:2009年11月14日 21:00