1.实现本机用户授权:
 
mysql>GRANT ALL ON *.*(databasename.tablename) TO 'username'@'localhost' IDENTIFIED BY 'userpassword'; (授权) 
 mysql>flush privileges; (更新权限)
 
2.实现异机用户授权:
 
mysql>GRANT ALL ON *.*(databasename.tablename) TO ‘username’@'client ip address' IDENTIFIED BY ‘userpassword’; (授权)
mysql> flush privileges; (更新权限)
 
注:*.*表示所有数据库所有表。