0
votes

I'm trying to insert a large amount of data with mysql -u username -p dbname < filename.sql and getting ERROR 1136(21S01) at line 1: Column count doesn't match value count at row 1, but I'm inserting into a database with its primary key and one variable to be inserted, so I'm confused as to why it won't accept 1 argument.

CREATE TABLE players(
player_id INT UNSIGNED auto_increment PRIMARY KEY,
name VARCHAR(100)
)engine=InnoDB CHARSET utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO players(name)
VALUES
(Seranul, Contherious, Unicorns, ... );
1

1 Answers

3
votes

You have to insert values on a row by row basis, where each row is enclosed in parentheses. Since your values are strings they must be enclosed in quotes as well:

INSERT INTO players(name)
VALUES
('Seranul'),
('Contherious'),
('Unicorns'),
...
;