How can I create and import a database using command line ?Mandeep Singh·Jan 25, 2023·1 min readcreate backup sudo mysqldump -u root -p dbname > backup.sql I believe the format is: mysql -u username -p database_name < /path/to/file.sql From within mysql: mysql> use db_name; mysql> source backup-file.sql; MySQLDatabasesImport Share this