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';
相关文章
相关标签/搜索