How to import a MySQL database from the terminal?
P粉990568283
P粉990568283 2023-10-10 11:36:13
0
2
592

How to import mysql database from terminal?

I can't find the exact syntax.

P粉990568283
P粉990568283

reply all(2)
P粉633075725

Preferred method for Windows:

  1. Open the console and start interactive MySQL mode

  2. use;

  3. source

P粉936568533

Assuming you are using a Linux or Windows console:

Prompt for password:

mysql -u <username> -p <databasename> < <filename.sql>

Enter password directly (unsafe):

mysql -u <username> -p<PlainPassword> <databasename> < <filename.sql>

Example:

mysql -u root -p wp_users < wp_users.sql

mysql -u root -pPassword123 wp_users < wp_users.sql

See also:

4.5.1.5. Execute SQL statements from text files


Note: If you are using Windows, you must cd (change directory) to the MySQL/bin directory within CMD before executing the command. p>

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template