1、mysql -u root -p
create database name;
use name;
source 『将.sql文件直接拖拽至终端,自动补全其文件目录』
要分号
2、设置密码
报错:Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
解决办法(修改加密规则为普通模式,默认是严格加密模式):
mysql修改密码
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; (修改加密规则 (必写))
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; (更新用户密码 )
FLUSH PRIVILEGES; #刷新权限(不输入也可以)
网友评论