Database Restoration

hmaddy

Verified User
Joined
Apr 17, 2019
Messages
288
i need to restore one database from one server to new server with new username.

For Eg: Existing database name like cpanelusername1_dbname.sql. i need to restore the content of these database to new server with cpanelusername2_dbname. Is this possible.
 
You can run the following command via SSH to restore the database:

Code:
mysql -u cpanelusername2 -p cpanelusername2_dbname < cpanelusername1_dbname.sql

The MySQL user (cpanelusername2) and database (cpanelusername2_dbname) have to be created before you run the command.
 
Back
Top