1.列出所有数据库: show databases;
2.创建库:create database mkt(库名);
3.切换数据库:use '数据库名';
4.列出所有表:show tables;
5.显示数据表结构:
mysql>describe 表名;
6.添加用户授权
添加用户:
GRANT USAGE ON *.* TO 'libaowen'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
修改密码:
update mysql.user set authentication_string=password('123456') where user='libaowen';
授予用户通过外网IP对于该数据库的全部权限:
grant all privileges on `mkt*`.* to 'libaowen'@'%' identified by '123456';
flush privileges;