MySQL learning simple notes

mysql command line:

import or run the sql file, run in the bin directory of mysql:
source "pathname"+/mytest_emp_dept.sql;


Export sql file mysqldump -u username -p password database name > export file address;
mysqldump -uroot -pPassword [database name] > [dump file]


Query all table names in the specified database
select table_name from information_schema.tables where table_schema='数据库名' and table_type='base table';


Tables with too much data should retain the table structure, delete the data, and do not want to rebuild the table, you can use:
truncate table [table name];



For more information, refer to http://www.cnblogs.com/feichexia/p/MysqlDataBackup.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326259665&siteId=291194637