mysql 遠程訪問

一、登陸數據庫

mysql -u root -p

二、受權法

mysql> use mysql;
Database changed
mysql> grant all privileges  on *.* to myuser@'%' identified by "mypassword";
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

    若是是固定ip就這麼寫mysql

grant all privileges on *.* to 'myuser'@'192.168.0.49'identified by 'mypassword';
相關文章
相關標籤/搜索