首先 , 以 root 进入 mysql , 创建远程访问用户 remote, 这个用户除了有远程访问权限外 , 还据有于 root 相同的其他权限 . iu VASg3T
$ mysql-u root -p ;b Yc{N1
Enter password: Cw8- }&lC
Welcome to the MySQL monitor. Commands end with ;
Your MySQL connection id is 67 to server version: 4.0.18
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql > GRANT ALL ON *.* TO root@'%' IDENTIFIED BY 'mysql' WITH GRANT OPTION;
Query OK, 0 rows affected (0.04 sec)
对 GRANT 语句的简单说明:
GRANT
ALL 所有权限
ON *.* 在所有的数据库上
TO root@’%’ 对 root 用户,在所有其他 IP 上的 root 用户(注: mysql 按照用户名和所在 IP 区分用户,所以 root 和 root@% 不是同一个用户)
IDENTIFIED BY ‘mysql’ 口令为 mysql