創建用戶(%表示隨處可登錄,localhost表示只能本地登錄
create user 'username'@'%' identified by 'password';
分配權限
grant all privileges on tableName.* to 'username'@'%';
刷新權限
flush privileges;
如果報錯ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
先執行flush privileges;再進行操作
