tags:

views:

264

answers:

6

I need to dump a database from a shared hosting that somehow doesn't have mysqldump installed. In fact, I only have mysql and mysqladmin available from the whole set of MySQL utilities.

Is it doable or I'll need to resort to installing something like phpMyAdmin?

A: 

how about shutting down the server and copying the datadir itself?

Omry
Not possible: it's a shared hosting, I don't have root access.
Leonid Shevtsov
A: 

You can get SQLYog. It has a back up database as SQL Dump option for each database.

Zoidberg
+1  A: 

You could use the following methods (from Database Backups in the documentation)

Making Backups by Copying Files

MyISAM tables are stored as files, so it is easy to do a backup by copying files. To get a consistent backup, do a LOCK TABLES on the relevant tables, followed by FLUSH TABLES for the tables. You need only a read lock; this allows other clients to continue to query the tables while you are making a copy of the files in the database directory. The FLUSH TABLES statement is needed to ensure that the all active index pages are written to disk before you start the backup.

FLUSH TABLES WITH READ LOCK;

Closes all open tables and locks all tables for all databases with a read lock until you explicitly release the lock by executing UNLOCK TABLES. This is very convenient way to get backups if you have a file system such as Veritas that can take snapshots in time.

UNLOCK TABLES;

Making Delimited-Text File Backups

To create a text file containing a table's data, you can use:

SELECT * INTO OUTFILE 'file_name' FROM tbl_name

This method works for any kind of data file, but saves only table data, not the table structure.

To reload the output file, use"

LOAD DATA INFILE
Andre Miller
both methods require root access, so I don't think they will help here.
Omry
Neither of them requires root access, these commands are run inside the mysql command shell.
Andre Miller
Unfortunately, it does require FILE privileges on the database.
Leonid Shevtsov
A: 

You can connect to a server remotely with mysqldump. For example:

mysqldump -u poweruser -h remote.mysql.host database
leonm
That would be great if only most administrators, including myself and the one in question, did not disable remote MySQL access for security reasons.
Leonid Shevtsov
A: 

Anyways,

I had to resort to using the Sypex dumper, a web-based tool for fast (really fast, much faster than phpMyAdmin for instance) MySQL database dumping. It's in Russian, but the interface is fairly obvious.

Leonid Shevtsov
A: 

Maatkit seems quite appropriate for this with mk-parallel-dump and mk-parallel-restore.

elhoim