MySql:Exporting And Importing Data In Mysql

2,556 views
2,437 views

Published on

MySql:Exporting And Importing Data In Mysql

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,556
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
41
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

MySql:Exporting And Importing Data In Mysql

  1. 1. EXPORTING AND IMPORTING DATA IN MYSQL<br />
  2. 2. OVERVIEW<br />Different ways if exporting and importing <br />Exporting database in mysql<br />Importing database in mysql<br />
  3. 3. Different ways of exporting and importing data<br />Import and export data graphically via phpMyAdmin<br />Use an SSH tunel for mysql and use a third party tool<br />Use mysql command line<br />
  4. 4. Import and export data graphically via phpMyAdmin<br />Steps to export a database<br /> 1.Login to phpMyAdmin<br /> 2.Select the database<br /> 3.Select the export tab<br /> 4.Click select all so that tables in your database are selected<br />
  5. 5. 5.Under export tab, select sql<br />6.Select the structure<br />7.Select data<br />8.Select save file as and choose preferred compression format<br />9.Click on GO<br />Mysql data will be downloaded to your default browser’s destination.<br />
  6. 6. Steps to import a database from phpMyAdmin<br />before the data can be imported, the database must be created and user privileges must be assigned to it.<br />Login to your cpanel with your username and password<br />Click on mysql databases <br />
  7. 7. create your new database by entering the name<br />Click on “add database” Enter the username and password <br />Click on “add user” <br />Add new user to the database by selecting user and database<br />Click on “add user to database”<br />Click on “phpMyAdmin” <br />
  8. 8. 1.Login to phpMyAdmin<br />2.Select on import menu<br />3.Locate sql file on your computer<br />4.Click on GO<br />This method has limitations especially when we have to download very large files, this method doesn’t work well.<br />
  9. 9. EXPORTING DATABASE THROUGH COMMAND LINE<br />Use mysqldump which is a tool to export and import database<br />It is used to backup the database or move the databases from one server to the other server.<br />To export your data as a backup use<br /># mysqldump -u username -ppassword database_name&gt;FILE1.sql<br />
  10. 10. Replace the username, password and database name with your username, password and database details.<br />FILE1 will contain the backup file, download the file to your computer.<br />
  11. 11. IMPORTING DATABASE THROUGH COMMAND LINE<br />We can restore the data from backup file<br />Or<br />Import it from another MYSQL server.<br />
  12. 12. Upload the file FILE1.sql to the server and run the command<br />#mysql -u username -ppassword database_name&lt;FILE1.sql <br />Replace the username, password and database name with your username, password and database details.<br />
  13. 13. OTHER WAYS OF EXPORTING AND IMPORTING DATA<br />Data can be imported from a XML source and can be retrieved from MYSQL in XML format.<br />Import and export delimited data from ms excel or ms access.<br />
  14. 14. Visit more self help tutorials<br />Pick a tutorial of your choice and browse through it at your own pace.<br />The tutorials section is free, self-guiding and will not involve any additional support.<br />Visit us at www.dataminingtools.net<br />

×