A friend really wants to move his web site to my Slice Host slice. The website utilizes a MySQL database. He provided FTP login info, but little else. I've known as and e-mailed his webhost wishing they would have the ability to produce use of PHPMyAdmin if it's installed. I haven't received an answer from their store. Neither has my pal.

I'm able to discover the database username, password, title, etc. within the PHP files via FTP.

I attempted uploading and running (inside a browser) this PHP file:

$con = mysql_connect("mysql.address.com","user","password");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }

    mysql_select_db("databasename", $con);

system("mysqldump -uuser -ppassword databasename > dump.sql");

?>

...but it didn't produce a file named dump.sql around the server.

Any applying for grants the way i can accomplish transpire?

You could utilize mysql GUI tools while using account information you found, but this might only work in the server (or perhaps a file around the server).

Rather than calling a method() function that you simply will not get access to (neither are you going to have mysqldump generally on hosting that is shared), make use of the "echo" command with an sql query, so:

$myQuery = mysql_query("show tables");

while($row = mysql_fetch_row($myQuery))
{
  echo $row[0];
}

You might test if the ftp username/pass provides you with spend access (ssh) and check out running your command in the command line as recommended within the comments

I ought to add it has been some time since I have done php, so my code is probably not quite right but you get the drift :)

Ultimately, mysqldump is not special. It conveys using the MySQL server as with every other client. You can write PHP code to dump each table to e.g., xml after which more code to reload all of them. For many web applications, the database will just contain base tables, so you'll really just have:

SHOW DATABASES

SHOW TABLES

The above mentioned two will explain all of the tables you have to dump. You might perform a choose from information_schema.tables.

SHOW CREATE TABLE «foo»

This provides you with the SQL to recreate the table.

SELECT * FROM «foo»

This can (clearly) provide you with the data.

I am speculating rather than penning this, you are able to most likely find pre-existing code. phpMyAdmin has it, In my opinion, but that is a great deal of complexity just for carrying out a quick dump...

For those who have FTP and extremely want phpMyAdmin, why not do the installation then?