mysql -h 192.175.242.89 -u root
mysql -u root mysql mysql -u iiicbg mysql はNGみたい(上のはrootだから?)
Fedora Core release 3 (Heidelberg) にインストールしました。とりあえず、
MySQL-Max-5.0.15-0.i386.rpm MySQL-server-5.0.15-0.i386.rpm MySQL-client-5.0.15-0.i386.rpm <- Linux上のクライアント mysql-administrator-1.1.4-win.msi <- Windowsのクライアントとして
で動いてるっぽいです。
>mysql -u root mysql mysql> use mysql; Database changed mysql> select * from user; +-------------+------+----------+-------------+-------------+--------------+------------+ 〜 | Host | User | Password | Select_priv | Insert_priv | Update_priv | Grant_priv | 〜 +-------------+------+----------+-------------+-------------+--------------+------------+ 〜 | localhost | root | | Y | Y | Y | Y | 〜 | ctkyos18121 | root | | Y | Y | Y | Y | 〜 | localhost | | | N | N | N | N | 〜 | ctkyos18121 | | | N | N | N | N | 〜 +-------------+------+----------+-------------+-------------+--------------+------------+ 〜 4 rows in set (0.01 sec) mysql>
デフォルトでは、MySQLは外部からの接続を許可していません。あるユーザ(xxx)が外部から接続可能にする為には以下のようにします。
$ mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.15-max
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> SELECT Host, User, Select_priv, Insert_priv,Update_priv, Delete_priv FROM user;
+--------------+------+-------------+-------------+-------------+-------------+
| Host | User | Select_priv | Insert_priv | Update_priv | Delete_priv |
+--------------+------+-------------+-------------+-------------+-------------+
| localhost | root | Y | Y | Y | Y |
| localhost | | N | N | N | N |
+--------------+------+-------------+-------------+-------------+-------------+
4 rows in set (0.00 sec)
mysql> grant all on *.* to xxx identified by 'hogehoge';
Query OK, 0 rows affected (0.02 sec)
mysql> set password for xxx = password('hogehoge');
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
現在のアクセス:19748