Reputation: 1020
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
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
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
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