2023年12月

导出:

mysqldump -u UserName -p DatabaseName > DatabaseName.sql

导入:

mysql -u UserName -p DatabaseName < DatabaseName.sql

连接:mysql -u UserName -p
创建数据库:create database DatabaseName;
删除数据库:drop database DatabaseName;
查看数据库列表:show databases;
选择数据库:use DatabaseName;
显示表:show tables;
表结构:describe TabelName;
表数目:select count(*) from information_schema.tables where table_schema='DatabaseName';
查看权限:select * from mysql.user where user='UserName'\G
查看权限:show grants for UserName@host;
查询用户:select user,host from mysql.user;
授权所有权限:grant all privileges on DatabaseName.* to UserName@host identified by 'password';

30

半马


40
全马