mysql学习简单笔记

mysql 命令行:

导入或运行sql文件,在mysql的bin目录下运行:
 source "路径名"+/mytest_emp_dept.sql;


导出sql文件  mysqldump -u用户名 -p密码 数据库名>导出文件地址;
 mysqldump -uroot -pPassword [database name] > [dump file]


查询指定数据库中的所有表名
 select table_name from information_schema.tables where table_schema='数据库名' and table_type='base table';


数据量过大的表要保留表结构,把数据删除,不想重新建表可以使用:
truncate table [table name];



更多信息参考 http://www.cnblogs.com/feichexia/p/MysqlDataBackup.html

猜你喜欢

转载自lxmgfd.iteye.com/blog/2383434
今日推荐