MySql命令记录(随时更新)

基本命令

进入命令行

mysql -u user -p

创建数据库,设置编码方式

create database dbname default character set utf8;

查看数据库/表

show databases/tables;

切换数据库

use database_name;

用户管理

创建用户

create user username@host;

删除用户

delete from user where user='';

修改密码

切换到mysql库,更新用户表
update user set password = password('test') where user = 'test'

用户权限

用户权限

# MySQL

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×