JohnnyAlpha
Programmer
I have just started to learn MySQL, and I'm following the book "Sams teach yourself MySQL in 21 days" Seems that I might have made a mistake getting this book since I just noticed that it was published in 2000.
Anyway.. I also noticed that some examples are not working. One of these is the following command which should add a hostname and a database into the mysql main DB.
The problem is that when I enter....
mysql> INSERT INTO host VALUES('localhost','sample_db',
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
I get the following error.
ERROR 1136: Column count doesn't match value count at row 1
By questions are....
1-What am I doing wrong ?
2-What does each of the 'Y' represent ?
3-Am I correct in assuming that the columns mentioned in the error are the number of columns in the table called host (in the mysql database) if this is the case, it seems that this table has 6 columns (Field | Type | Null | Key | Default | Extra) so… why do I get the same error even when I reduce the number of entries I was asked to enter (including the 10 'Y') to a total of 6 (as shown hereunder)
INSERT INTO host VALUES('localhost','sample_db','Y','Y','Y','Y');
4-Did anyone use this book and found similar problems ?
5-Any other book you can recommend for a total beginner ?
Anyway.. I also noticed that some examples are not working. One of these is the following command which should add a hostname and a database into the mysql main DB.
The problem is that when I enter....
mysql> INSERT INTO host VALUES('localhost','sample_db',
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
I get the following error.
ERROR 1136: Column count doesn't match value count at row 1
By questions are....
1-What am I doing wrong ?
2-What does each of the 'Y' represent ?
3-Am I correct in assuming that the columns mentioned in the error are the number of columns in the table called host (in the mysql database) if this is the case, it seems that this table has 6 columns (Field | Type | Null | Key | Default | Extra) so… why do I get the same error even when I reduce the number of entries I was asked to enter (including the 10 'Y') to a total of 6 (as shown hereunder)
INSERT INTO host VALUES('localhost','sample_db','Y','Y','Y','Y');
4-Did anyone use this book and found similar problems ?
5-Any other book you can recommend for a total beginner ?