先用root登录运行如下代码
create user 'usrname'@'%' IDENTIFIED by 'password'; flush privileges; grant select, insert, update [DELETE]on databasename.* to usrname@'%'; flush privileges;
@'%' 是因为要远程访问,[]可不写