Home > Database > Mysql Tutorial > How to open a file in mysql

How to open a file in mysql

藏色散人
Release: 2020-11-13 09:17:44
Original
4391 people have browsed it

How to open a file in mysql: first open "My Computer->Properties->Advanced System Settings->Environment Variables"; then find the path; then add it to the mysql address on the computer bin directory; finally open cmd and enter the sql command to view the file.

How to open a file in mysql

Recommendation: "mysql video tutorial"

Open the file with the mysql command line

First of all, you need to configure system variables. Go to My Computer->Properties->Advanced System Settings->Environment Variables-> to find the path and add it to the bin directory under the mysql address on your computer, such as c :/wampp/mysql/bin

:打开cmd输入以下命令(不需要转换目录)
>
mysql
-u
root
-p
enter
password:
进入mysql后
mysql>use
test;
mysql>
source
c:/test.sql
Copy after login

ok execution completed

You can use show

tables; to see which tables are written (remember there is a semicolon after the statement). You can use desc

tablename; to view your table structure

The above is the detailed content of How to open a file in mysql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template