老版本的mysql 5.1添加用户:
insert into user(host,user,password) values(‘127.0.0.1′,’root’,password(‘rootpw’));
新版本mysql5.6添加用户:
create user ‘root’@’127.0.0.1’ identified by ‘rootpw’;
赋予所有权限:
GRANT ALL PRIVILEGES ON *.* TO ‘root’@’127.0.0.1’ WITH GRANT OPTION;