ubuntu 创建用户
1、创建用户
mysql> use mysql;
mysql> insert into user(Host,User,Password) values(“localhost”,”wangzh”,password(“123456″));
//刷新系统权限表
mysql>flush privileges;
创建数据库:
mysql> create database hockor default character set utf8;
2、给用户使用数据库赋权限
mysql>grant all privileges on hockor.* to wangzh@localhost identified by ’123456″;
mysql>flush privileges;
3、命令行修改root密码:
mysql> UPDATE user SET password=PASSWORD('新密码') WHERE User='root';
mysql> FLUSH PRIVILEGES;