View Full Version : MySQL question
Rykkers
08-05-2005, 06:01 AM
Hi folks!
I've got one that's probably a simple one to answer, but I've not read enough to know.
I have data (quite a number of tables full, mostly things like states and countries and the like that I use in forms for populating drop-downs) in a MySQL database here on my machine that I want to import into my DB here. Is that a task I can accomplish from within phpMyAdmin, or should I use Navicat or what?
Thanks in advance!
miguel
08-08-2005, 01:30 AM
Yes, it is possible to export data and structure via phpMyAdmin, provided that you have phpMyAdmin installed on your local computer. There should be an [Export] tab in the top horizontal bar, somewhere near the [Search] tab. There, you have plenty of options to choose from. I would suggest that you stick with the default SQL output. Do not forget to the check the box where it says "output to file". A save file dialog box will open once you click on the submit button. Save the file somewhere on your computer, then open the phpMyAdmin panel on your server (accessible via the cPanel->MySQL Databases section). Click on the [SQL] tab and then use the [Browse] button to select the sql dump file that you just saved. Click GO and watch for any error messages. That's about it.
In case you do not have phpMyAdmin installed on your pc, you can use the mysql command line tools to generate an sql dump file. The command is called mysqldump and the syntax goes like this:
mysqldump -Q --user=username database_name [table1 table1 ... tableN] > output_filename.sql
If you are running windows, you can skip the ' > output_filename' part and use windows-like output redirection, or just ommit that part and copy-paste the text output from the screen into the SQL section of the phpMyAdmin tool on the server.
Should you bump into any obstacles, do not hesitate to shout out loud for help here, or in the ticketing system :)
Rykkers
08-09-2005, 08:54 AM
Thanks, Miguel! I know I could have read and eventually found the answer, but time is short on this particular project - the hosting ended at another company, and I'm having to convert from MS Access to MySQL on top of everything else (no big deal there; Navicat is a great tool!) and get the site back up here.