mysqldump是mysql一个数据库常用工具,我们经常用它来实现数据和备份如,数据导入导出本文章来介绍最基本数据库导出与表导现的代码]
#dump 名 >数据库备份名
#mysqldump -A -u用户名 -p密码 数据库名>数据库备份名
#mysqldump -d -A --add-drop-table -uroot -p >xxx.sql
导出整个数据库database
代码如下 | 复制代码 |
mysqldump –opt -uroot -ppassword database > dump.sql |
导出单个数据表table
代码如下 | 复制代码 |
mysqldump –opt –add-drop-table -uroot -ppassword database table > dump.sql |
国外网站数据导入导出说明
For the impatient, here is the quick snippet of how backup and restore MySQL database using mysqldump:
代码如下 | 复制代码 |
backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql restore:# mysql -u root -p[root_password] [database_name] |
1. Backup a single database:
This example takes a backup of sugarcrm database and dum the output to sugarcrm.sql
代码如下 | 复制代码 |
# mysqldump -u root -ptmppassword sugarcrm > sugarcrm.sql |
# mysqldump -u root -p[root_password] [database_name] > dumpfilename.sqlThe sugarcrm.sql will contain drop table, create table and insert command for all the tables in the sugarcrm database. Following is a partial output of sugarcrm.sql, showing the dump information of accounts_contacts table:
代码如下 | 复制代码 |
-- DROP TABLE IF EXISTS `accounts_contacts`; -- LOCK TABLES `accounts_contacts` WRITE; |
点击查看
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号