there is life after phpmyadmin!
**EDIT TO THE EDIT: It turns out that the remote access permission was exactly the problem. I had to go into my hosting account’s CPanel and add my IP address to the remote access permissions. Then, in MySQL Administrator, you simply use the server’s IP address as the host and the db user name & password. Easy squeezy.
***EDIT: After all of my excitement below, I’m having a hard time connecting to shared hosts with the software. “Remote access” has to be enabled on the database for it to work, which is probably a good chunk of my problem. A big part of it, too, is figuring out what the actual server address is—the virtual host name doesn’t work. The more obfuscation there is, the more complicated things become.***
In all my days of dinking with MySQL databases both professionally and privately, I have never run into a time where the PHPMyAdmin web-based administration tool couldn’t do what I needed it to do. But, I had never done anything with a truly large database, either—Joomla!, WordPress and the like just aren’t that big (at least in their initial states, prior to being populated with a lot of content). Neither were the databases for any of my hand-rolled applications.
All of that changed when I was tasked at work with moving a WordPress blog to a new server. Having done this several times before, I thought little of it—just a quick export via PHPMyAdmin, and then an import of same. A few minor changes to the WordPress config file and badabing! We’re on the air. Upon inspection, it turned out that the database for this particular blog was 62MB—not that large in my estimation, but apparently so for PHPMyAdmin. I tried a few times to do the standard table export, but it always hung before the process could complete. I still don’t know what the practical limit is for PHPMyAdmin, but apparently it’s less than 62MB.
So, I was left wondering just what exactly I should do. As luck would have it, the server we were moving from is a “real” server (virtual dedicated, actually) with access to the command line—a treat for this old shared hosting warhorse. It is a Windows box, but the MySQL prompt was still available. I started searching for command-line backup or export information and came up with a few different options. I ran into a few problems because most of them were for linux boxes, and the Windows syntax is slightly different. The one I ultimately used successfully was this one:
mysqldump -u username -p --databases dbname > output.db_filename.sql
Run that from the MySQL installation directory and you’re golden (once you move the resulting file somewhere you can use it, that is).
However, while working that out it occurred to me that the new server was good ol’ shared hosting, with no SSH access or command line to be had. If PHPMyAdmin couldn’t export a file that size, would it be able to import one? I was justifiably afraid that my triumph would be short-lived. I started looking for PHPMyAdmin alternatives.
What I ran across somewhat accidentally surprised me (I’m kinda thick that way): a solution straight from the horse’s mouth! The gang at MySQL/Sun have a set of GUI tools for MySQL that not only work on local databases, but remote ones, as well. I downloaded the MySQL Administrator application and in short order I was in business. I was able to connect to the old database, do an export, then connect to the new database and import in relatively short and painless order. Why hadn’t I seen this before now???? The Administrator includes the Query Browser, as well, so it’s kind of a one-stop shop for blossoming database geeks.
If there’s a way to create new db’s in MySQL Administrator I’m not aware of it; that’s still a chore for the host’s wizards or PHPMyAdmin. But for routine maintenance and backups, I’m pulling up stakes and switching to these apps until I find a reason not to.
See, I’m easy to please!