首先
,
以
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 ; or \g.
(zbV/ ^W V
?
Your MySQL connection id is 67 to server version: 4.0.18
~U{r *
?
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
[[j8)_YW#
mysql
>
sM1*B^fn
?
mysql
> GRANT ALL ON *.* TO root@'%' IDENTIFIED BY 'mysql' WITH GRANT OPTION;
kk
*J7
?
Query OK, 0 rows affected (0.04 sec)
)khi(8[1]^
?
mysql
>
mD0h|-Cg
?
?
對
GRANT
語句的簡單說明:
GRANT
ALL???????????
所有權限
ON *.*??????
在所有的數據庫上
TO root@’%’???
對
root
用戶,在所有其他
IP
上的
root
用戶(注:
mysql
按照用戶名和所在
IP
區分用戶,所以
root
和
root@%
不是同一個用戶)
IDENTIFIED BY ‘mysql’?????
口令為
mysql
?
然后修改
mysql
配置文件讓它監聽外部
ip
端口
,
修改
/etc/my.cnf
文件中的一下部分
:
# keep secure by default!
gjL|8s]
?
bind-address = 127.0.0.1
K C:c?J
?
port = 3306
Wj
{~D2,
?
把
bind-address = 127.0.0.1
注釋掉即可
a