Rayan Sp
Rayan Sp

Reputation: 1020

How can I export mysql database without cpanel access

I would like to export mysql database from one hosting to another but I don't have the cpanel username & password, therefore I can't do it through phpMyadmin. How can I export the database?

I have the database username & password. Also FTP access

Upvotes: 0

Views: 2362

Answers (3)

mister martin
mister martin

Reputation: 6252

If you have SSH access:

// SSH into the server
> ssh -p 22 user@ip

// create your backup
mysqldump --user=username --password="password" --host=localhost database_name > /path/to/export.sql

If you don't have SSH access, try executing the above dump with PHP's exec or shell_exec.

If you don't have the privileges to use the functions above, you can configure a local installation of PHPMyAdmin to use an external server as outlined in this answer.

Upvotes: 0

TGITC
TGITC

Reputation: 3

Is the database for a website to which you have back-end access? Most CMS systems offer a module where you can access and download the site's database via the site's admin area (EG ART Adminer in Joomla).

Upvotes: 0

JosMac
JosMac

Reputation: 2302

I would recommend you to use mysqldump command line tool (http://dev.mysql.com/doc/refman/5.7/en/mysqldump.html) with --opt --single-transaction switches. Presuming you have username & password and grants on database allowing you to connect from some other IP. You can install these tools on your local machine - they are part of mysql-client-x.x package.

Upvotes: 1

Related Questions