0

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

Rayan Sp
  • 1,002
  • 7
  • 17
  • 29

3 Answers3

1

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.

JosMac
  • 2,164
  • 1
  • 17
  • 23
0

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).

TGITC
  • 3
  • 1
  • 6
0

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.

Community
  • 1
  • 1
mister martin
  • 6,197
  • 4
  • 30
  • 63