How to Export a SQL Table Without Access to the Server or PHPmyadmin

Easy way to export a SQL table without access to the server or phpMyADMIN

You could use SQL for this:

$file = 'backups/mytable.sql';
$result = mysql_query("SELECT * INTO OUTFILE '$file' FROM `##table##`");

Then just point a browser or FTP client at the directory/file (backups/mytable.sql). This is also a nice way to do incremental backups, given the filename a timestamp for example.

To get it back in to your DataBase from that file you can use:

$file = 'backups/mytable.sql';
$result = mysql_query("LOAD DATA INFILE '$file' INTO TABLE `##table##`");

The other option is to use PHP to invoke a system command on the server and run 'mysqldump':

$file = 'backups/mytable.sql';
system("mysqldump --opt -h ##databaseserver## -u ##username## -p ##password## ##database | gzip > ".$file);

Is there a way of viewing the export query run by PHPMyAdmin on a database?

phpMyAdmin 4.5.0+ supports export templates. On the export screen, you can create an export template with the settings you need. They are per server, but we can do something about that.

By default (this can be configured in PMA's config file), PMA stores these export templates in the database phpmyadmin and table pma__export_templates.

Provided that you have full access to all databases on your servers, including the phpmyadmin one, you can do this:

  • Create an export template with the settings you want on one of the servers.
  • Export the export template itself from the phpmyadmin.pma__export_templates table.
  • Import the template to phpmyadmin.pma__export_templates on the next server.
  • Go to the export screen there and load the template.

How to convert the access database file into sql file for imporing in phpmyadmin

I have used this tool http://www.bullzip.com/products/a2m/info.php to import Access-databases into mysql. It has worked good for me.

How to export in phpmyadmin not include id column (the AUTO_INCREMENT column)

Go to SQL tab and manually write your select query without id column (SELECT name, address, ... FROM your_table).
Then once you get the table with the results, scroll down to the bottom of the page and you'll see export icon inside the gray "Query results operations" fieldset. This should work for you.

Screenshot per request (see very bottom):
Sample Image



Related Topics



Leave a reply



Submit