mysql创建用户并赋予权限
2018-08-24 本文已影响0人
lyhwbt
登录
mysql -u root -p
添加用户
create user 'test'@'%' identified by '123456'
分配权限( 注意 引号 和 ` )
grant all privileges on `testdb`.* to 'test'@'localhost' identified by '123456';
刷新授权
flush privileges;
mysql -u root -p
create user 'test'@'%' identified by '123456'
grant all privileges on `testdb`.* to 'test'@'localhost' identified by '123456';
flush privileges;