MySQL workbench and PHPMyAdmin

0 Shruti Gopal · October 9, 2014

Anyone know how to export tables from PHPMyAdmin and import them into MySQL workbench?  I want to run a SQL script on two tables from database that is on PHPMyAdmin, but I wanted to do this outside of  PHPMyAdmin so that the database running is not affected.  Any ideas?

Post a Reply


Oldest  Newest  Rating
0 Eugene Botma · October 11, 2014
Oh, i see. In that case it's rather easy.

in phpAdmin, select the database you want to export.
Then in the bar at the top of the page, click on export.
Select the quick export method, sql format and click export.
save the file somewhere.

then on he local server, create a new database. create a new query and ensure that it is using the new database (use [databasename]). Load the content of the sql file into the query window and let it run.

That should completely clone the database.

Just 1 thing though. exporting the database in this way can be IO intensive on large DB's. If the DB you are pulling the database over the internet and it is a large DB, it can take pretty long. SQL files multiply the size of the database somewhat with all of the extra content (insert into etc etc).

I suggest you look at the custom settings for exporting and only export the schema into a sql file, then export the data itself into a csv file. On your local computer, write a small program to import the data from the csv into the sql server.
0 Shruti Gopal · October 13, 2014
Thanks Eugene, for explaining that. :-) I've exported the database that I need as a SQL file from PHPMyAdmin and have saved it.  I'm new to using PHPMyAdmin, so not sure how to connect to the local server.  How can I do this or is there an alternative simpler way?
0 Eugene Botma · October 15, 2014
how did install the local server?

try going to http://localhost/phpmyadmin and see if it loads. This will be the local server. you can probably use an import feature somewhere.
0 Eugene Botma · October 9, 2014
MySQL workbench is only a visual tool to interact with the database. Connecting to the database using workbench is exactly the same as using PHPMyAdmin. Running a script on either will have the same effect of both.

Besides, you can't run a script or query without affecting the DB. 
0 Shruti Gopal · October 10, 2014
Thanks for reply.  I wanted to export a database from PHPMyAdmin as a SQL file and then import it on  a local database, so that any SQL querying I do doesn't affect the live database on PHPMyAdmin.  Is this possible?
  • 1

SQL & Databases


Everything SQL and Databases related in here!

Bucky Roberts Administrator