upload database mysql command line 1

upload database mysql command line

mysql -u username -p database_name < file.sql


Note-1: It is better to use the full path of the SQL file file.sql.

Here is what the above code is Doing:
1. It is connecting to the database using the mysql command.
2. The -u flag is used to specify the username.
3. The -p flag is used to specify the password.
4. The database_name is the name of the database to which you want to connect.
5. The < symbol is used to specify the input file. 6. The file.sql is the name of the SQL file that you want to import.

Similar Posts