登錄
mysql -u root -p
添加用戶
create user 'test'@'%' identified by '123456'
分配權(quán)限( 注意 引號(hào) 和 ` )
grant all privileges on `testdb`.* to 'test'@'localhost' identified by '123456';
刷新授權(quán)
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;