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 [email protected] identified by ’123456″;
mysql>flush privileges;
3、命令行修改root密码:
mysql> UPDATE user SET password=PASSWORD(‘新密码‘) WHERE User=‘root‘;
mysql> FLUSH PRIVILEGES;
时间: 2024-10-03 06:57:05