Mysql 添加用户并配置权限

Jun 24, 2016

mysql> CREATE DATABASE test_demo /*!40100 DEFAULT CHARACTER SET utf8 */;

mysql> CREATE USER ‘test’@’192.168.1.101’ IDENTIFIED BY ‘123456’;

mysql> grant all privileges on test_demo.* to test@’%’ identified by ‘123456’;

##Access denied for user ‘root’@’%’ to database ‘xxx’ 原因是由于该用户没有授权,使用Mysql 安装的服务器所在的主机用命令行执行命令即可.

mysql> flush privileges;//刷新系统权限表