mysql export/import database command line ubuntu

Log in a MySQL root user:

$ mysql -u user -p

Run the SHOW DATABASES command:

mysql> SHOW DATABASES;

EXPORT from MySql

$ mysqldump -u [username] -p [database name] > [database name].sql

IMPORT in MySql

$ mysql -u [username] -p newdatabase < [database name].sql

Disabling “Use Socket For PHP-FPM” did the trick.


Leave a Reply