MySQL: import a dump

Martin Zeller MySQL 0 Comments

If you have got a sql-File and want to import it to your MySQL database then you can do this with a simple line in the shell:


mysql -u username -p password -h databaseservername  datebasename < sqlfile.sql

Example:
Say there is a local MySQL database, with a database called ‚mybestsellers‘, we have got a dump file ‚/home/users/jripper/bestsellerdump.sql‘ and we connect to our database with username ‚dbuser‘ and password ‚xxx‘
Our input at the shell would be:


mysql -u dbuser -p xxx -h localhost mybestsellers < /home/users/jripper/bestsellerdump.sql

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.