Wangdake - mysql
type: channel
link: https://www.wangdake.top/index.php/tag/mysql/
items: mysql 导出导入数据库

mysql 导出导入数据库
type: item
date: 2023-12-15T18:35:00+08:00
description: 导出：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';