# 执行命令切换到mysql 数据库 use mysql; update user set authentication_string='' where user='root' and host="localhost"; flush privileges; alter user 'root'@'localhost' identified by 'password'; exit;
#创建数据库 create database sina default character set utf8mb4 collate utf8mb4_unicode_ci; #创建用户 create user 'user'@'%' identifiedby 'password'; #给用户赋权限 GRANT ALL PRIVILEGES ON sina.* TO 'user'@'%' WITH GRANT OPTION; flush privileges;