Mysql method to execute sql script file: 1. Enter [mysql -h localhost -u root -p123456
Mysql method of executing sql script file:
The first method:
In Under the command line (not connected to the database), enter mysql -h localhost -u root -p123456 < F:\hello world\niuzi.sql
(note that the path does not need to be quoted!!) and press Enter. .
Second method:
In the command line (the database is connected, the prompt at this time is mysql>), enter source F:\hello world\niuzi.sql
(note that the path does not need to be quoted) or \. F:\hello world\niuzi.sql
(note that the path does not need to be quoted) and press Enter.
More related free learning recommendations: mysql tutorial(video)
The above is the detailed content of mysql executes sql script file. For more information, please follow other related articles on the PHP Chinese website!