1.创建新用户 'xiaoxiao'密码'123456'
mysql> CREATE USER 'xiaoxiao'@'localhost' IDENTIFIED BY '123456';
2.问题:Navicat使用xiaoxiao链接,看不到新建的数据库testDB怎么办?
//用户添加使用testDB权限 grant all privileges on testDB.* to xiaoxiao@localhost identified by '123456';
3.为xiaoxiao用户添加远程访问权限
mysql> GRANT ALL PRIVILEGES ON testDB.* TO 'xiaoxiao'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
4.刷新权限表
flush privileges;
5.Navicat刷新,或者重新连接,ok!