进入:
mysql -u 用户名 -p【回车后输入密码即可】
更改密码:
alter user "用户名"@"localhost" identified with mysql_native_password by "新密码"【某个数据库下的用户需要先use数据库】
创建数据库:
create database 数据库名
使用数据库:
use 数据库名
创建用户:
create user "用户名"@"localhost" identified by "密码"
给用户授权:
grant all privileges on 用户名.* to "用户名"@"localhost"【授予全部权,localhost代表本地,%代表所有ip,当然也可以输入单独的ip】
喜欢的点个赞❤吧!