MySQL import SQL file using comand line

来源:互联网 发布:js实现颜色渐变 编辑:程序博客网 时间:2024/05/18 10:06

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.