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.
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!