有关mysql导出与导入数据的方法,常用的导出与导入sql语句。
1、mysql导出数据库及表
mysql -uusername -ppassword databasename (tablename)> filename.sql
2、mysql导入数据库
grant all privileges on *.* to 'username'@'localhost' identified by 'username' with grant option;
创建数据库:
create database databasename;
创建数据表:
create table tablename.....
导入数据库:
mysql -uusername -ppassword databasename (tablename)< filename.sql
|