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

How to insert multiple pieces of data in mysql

王林
Release: 2020-10-19 10:59:04
Original
19069 people have browsed it

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
Copy after login

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

SHOW DATABASES;
USE 数据库
Copy after login

3. Check the data format in the table.

SELECT * FROM example;
DESCRIBE example;
Copy after login

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

INSERT INTO example()
VALUES
(),
(),
();
Copy after login

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!

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