Home >Database >Mysql Tutorial >How to insert multiple pieces of data in mysql

How to insert multiple pieces of data in mysql

王林
王林Original
2020-10-16 09:18:5119057browse

Mysql method of inserting multiple pieces of data: 1. Log in to the mysql database; 2. Specify the database to insert multiple pieces of data; 3. View the data table format; 4. Execute [INSERT INTO data table VALUES(); 】 statement to insert data.

How to insert multiple pieces of data in mysql

1. Log in to mysql

(Recommended tutorial: mysql video tutorial)

mysql -uroot -p

2 . Check which database is used. Here we use testdb as an example.

SHOW DATABASES;
USE 数据库

3. Check the data format in the table.

SELECT * FROM example;
DESCRIBE example;

4. Use this format to input multiple data and separate them with commas.

INSERT INTO example()
VALUES
(),
(),
();

Related recommendations: mysql tutorial

The above is the detailed content of How to insert multiple pieces of data in mysql. 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