http://blog.youkuaiyun.com/aizhiqiang2/article/details/51685308
密码登录 : mysql -u root -p
这个可以 :
grant usage on *.* to 'username'@'localhost' identified by 'password' with grant option; // 创建用户
grant select, insert, update, delete, create, drop on tablename.* to 'username'@'localhost' identified by 'password'; // 授权单个表
grant select, insert, update, delete, create, drop on *.* to 'username'@'localhost' identified by 'password'; // 授权所有表
flush privileges; // 刷新权限
select host, user, password from mysql.user;
------------------------------------------------------------------------------------------------------------------
insert into mysql.user(host, user, password) values ('localhost', 'test' , password('123')) // 通过用户授权
insert into mysql.user(host, user, password, ssl_cipher, x509_issuer, x509_subject) values ('localhost', 'gpower', 'gp2018', '0', '0', '0');
select host, user, password from mysql.user;