🗳️ Import & Export Database to & from MySQL using CLI

April 4, 2020 (4y ago)

Import database to MySQL

🖥️

mysql -u [username] -p [databasename] < [filename.sql]

Export database from MySQL

🖥️

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