- 通过命令行修改密码:mysqladmin -uadmin -p password
- 通过sql语句修改:
update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
- 创建用户,授予权限:
-
create user 'test'@'localhost' identified by '000000'; GRANT ALL PRIVILEGES ON *.* TO 'test'@'%' IDENTIFIED BY '000000' WITH GRANT OPTION;