Home >Database >Mysql Tutorial >mysql executes sql script file

mysql executes sql script file

coldplay.xixi
coldplay.xixiOriginal
2020-09-30 10:52:5320374browse

Mysql method to execute sql script file: 1. Enter [mysql -h localhost -u root -p123456

mysql executes sql script file

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn