MySQL import SQL file using comand line

1. Click "Start" Menu, input "cmd", then click Enter.

2. Type the following command:

mysql -u <username> -p <database_name>   <  /path/to/file/textfile.sql , then click Enter.

For example:

mysql -u test -p db_roseindia < C:/EclipseWorkSpace/Hibernate3QueryExample/db/load_data.sql , then click enter.

3. Input the password for MySQL user 'username', then click Enter.

你可能感兴趣的:(sql,mysql,File,database,input,import)