By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,949 Members | 1,869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,949 IT Pros & Developers. It's quick & easy.

exporting & importing database

P: 35
i am doing the programming at home and our teacher checks it in school that's why i need to export/import my database.. but i dont know how..
i've found this instruction on the net but i cant understand

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.

# mysqldump -u username -ppassword database_name > FILE.sql

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.

# mysql -u username -ppassword database_name < FILE.sql

Replace the parts in red with your own information.

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.


in #1 it says that i have to download "FILE.sql" to my computer.. but the problem is i dont know where will i find "FILE.sql"
Feb 9 '08 #1
Share this Question
Share on Google+
6 Replies


P: 50
Give th efull path of the local machine and directory insteed of the File.sql gives the C:\mydata\filename.sql
Feb 9 '08 #2

P: 35
Give th efull path of the local machine and directory insteed of the File.sql gives the C:\mydata\filename.sql
what do you mean by "local machine"? i cant understand what you're instructing me.. kindly explain further
Feb 10 '08 #3

ak1dnar
Expert 100+
P: 1,584
what do you mean by "local machine"? i cant understand what you're instructing me.. kindly explain further
Mirian, you haven't tell us about the operating system that you are using. What sandeepsandeep is saying actually if you are using a windows machine (Local Machine == Your PC), set the full path to save the file.
Expand|Select|Wrap|Line Numbers
  1. mysqldump -u<username> -p database_name >  /path/to/filename.sql
Feb 10 '08 #4

hsriat
Expert 100+
P: 1,654
i am doing the programming at home and our teacher checks it in school that's why i need to export/import my database.. but i dont know how..
i've found this instruction on the net but i cant understand

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.

# mysqldump -u username -ppassword database_name > FILE.sql

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.

# mysql -u username -ppassword database_name < FILE.sql

Replace the parts in red with your own information.

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.


in #1 it says that i have to download "FILE.sql" to my computer.. but the problem is i dont know where will i find "FILE.sql"

There is one simple solution for your problem....
Use HEIDI SQL (free download)

http://www.heidisql.com/

Just a button will do the whole job..

(Open both the connections in different Heidi SQL window and then click on the export button in the one whom you want to export.)
Feb 10 '08 #5

ak1dnar
Expert 100+
P: 1,584
There is one simple solution for your problem....
Use HEIDI SQL (free download)

http://www.heidisql.com/

Just a button will do the whole job..

(Open both the connections in different Heidi SQL window and then click on the export button in the one whom you want to export.)
Why not MySQL GUI tools And phpMyAdmin
Feb 10 '08 #6

hsriat
Expert 100+
P: 1,654
Why not MySQL GUI tools And phpMyAdmin

ummm...
Actually I exported my database using heidiSQL, and I found it easy to use than phpMyAdmin.

I haven't used used My SQL GUI tools..., but this migration tool seems to be interesting...
Feb 10 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.