• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Importing large sql file via SSH

SamirM

Regular Pleskian
I have been trying quite unsuccessfully to import a large sql db file via phpMyAdmin for one of my clients. Since the db file is about 250mb I get a server timeout error.
Can anyone guide me as to how I can do this via SSH
I have a CentOS server 6.5, 64 bit that runs Plesk v 12.0.18
Thanks in advance
 
Hi SamirM,

please create a database over Plesk and then use the command over SSH:

mysql -u admin -p`cat /etc/psa/.psa.shadow` YOUR_DATABASE_NAME_WHICH_ALREADY_SHOULD_BE_CREATED < /path_to_your_SQL/NAME_OF_THE_SQL_WHICH_SHOULD_BE_IMPORTED.sql
 
thnx UFHH01, and pardon my lack of knowledge, but do i need to provide the db username and password in the above command
 
Hi SamirM,

due to the case, that the above command uses the MySQL . Admin as username and the corresponding password, there is no need for any DB - username and DB - password, just replace "YOUR_DATABASE_NAME_WHICH_ALREADY_SHOULD_BE_CREATED" and "/path_to_your_SQL/NAME_OF_THE_SQL_WHICH_SHOULD_BE_IMPORTED.sql" with your correct DB - name and path to your SQL.
 
I used a slightly different command to import the db successfully, here is what i used:
mysql -u username -p dbname < the exact path whr the sql file us located/dbfile.sql , when you hit enter, it will ask for the password for the db and then start the import process, which if its a very huge db will take an inordinate long time to complete
 
Hello everyone, I hope this message is useful to people like me who happened on this page. Also I hope that after years you have solved :))) LOL
You can also use an app that splits the database (just set how many cuts and what size) in order to generate 2-3 files of 60-80mb each.
I always use a free DBSPLITTER in order to facilitate uploads with phpmyadmin.
Always follow the instructions. a schema file must be imported first, then the cut files.
I hope it is useful.
 
Back
Top