How to import an SQL file using the command line in MySQL? mysql -u username -p database_name < /path/file.sql It will ask for password after this command
Category: command line
mysql, import sql file from command line
Method 1: A quick way to duplicate MySQL databases is to do the following: Step 1: Dump the database either through PHPMyAdmin’s export form or through mysqldump (as I mentioned above). Note (usually, it’s mysqldump <database-name> -h<hostname> -u<username> -p<password> if you ommit the -h switch it will default to “localhost”). After you enter the command… Continue reading mysql, import sql file from command line