Home >Database >Mysql Tutorial >数据库的导入和导出(ubuntu 12.04.04 server)

数据库的导入和导出(ubuntu 12.04.04 server)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 15:42:131016browse

1.mysql a)用wlan/wlan账户导出myql中iwncomm数据库实例中的表结构和数据 mysqldump -uwlan -pwlan --quick iwncomm | gzip iwncomm.contents.gz b)用wlan/wlan账户向mysql中的iwncomm数据库实例导入表结构和数据 gunzip iwncomm.contents.gz | mysql -uwl

1.mysql

a)用wlan/wlan账户导出myql中iwncomm数据库实例中的表结构和数据

mysqldump -uwlan -pwlan --quick iwncomm | gzip > iwncomm.contents.gz


b)用wlan/wlan账户向mysql中的iwncomm数据库实例导入表结构和数据

gunzip

也可以考虑

mysql -u wlan -p wlan

2.sqlite

a)数据导出

执行sqlite3 wlc4008.db进入sqlite环境
SQLite version 3.7.7.1 2011-06-28 17:39:05
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .output iwncomm.sql
sqlite> .dump
sqlite>quit

可以在当前目录下看到iwncomm.sql,里面是所有数据库表的结构以及数据的创建sql脚本。

b)数据导入

sqlite3 new_wlc4008_db.db

chmod 777 new_wlc4008_db.db

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn