跳至内容
Python 俱乐部
用户工具
登录
站点工具
搜索
工具
显示页面
修订记录
反向链接
最近更改
媒体管理器
网站地图
登录
>
最近更改
媒体管理器
网站地图
您的足迹:
php-mysql:import-export-database
====== Import Export MySQL Database From Command Line ====== MySQL Tutorial - Import or Export A Database This tutorial section deals with mysqldump which is a tool to import and export MySQL databases. (this is all done via command line , you will need to ssh into your account) It can be used to back up a database or to move database information from one server to another. ===== 1. Export A MySQL Database ===== This example shows you how to export a database. It is a good idea to export your data often as a backup. <code> 1. mysqldump -u username -p database_name > FILE.sql 2. Press Enter 3. You will be prompted for a password 4. Type in the password for the username and press Enter. </code> Replace username, password and database_name with your MySQL username, password and database name. File FILE.sql now holds a backup of your database, download it to your computer. ===== 2. Import A MySQL Database ===== Here, we import a database. Use this to restore data from a backup or to import from another MySQL server. Start by uploading the FILE.sql file to the server where you will be running this command. <code> 1. mysql -u username -p database_name < FILE.sql 2. Press Enter 3. You will be prompted for a password 4. Type in the password for the username and press Enter. </code> This powerful, easy to use command has many uses. Let's say you wanted to switch web hosting providers. Simply export your data on the old provider's server and import it on your account with the new host.
php-mysql/import-export-database.txt
· 最后更改: 2010/06/02 01:18 (外部编辑)
页面工具
显示页面
修订记录
反向链接
回到顶部