Jump to content

MySQL Column count does not match value count at row 1

- - - - -

  • Please log in to reply
4 replies to this topic

#1
dink

dink

    Newbie

  • Members
  • Pip
  • 2 posts
Hello everyone!
I am new to mysql and php. I do have some knowledge of C++, Java, and ASP.
This is the deal:
I bought the oscommerce for professionals to help with a website I need to create. I downloaded and installed the MySql version 5.01. Installations was successful.

command line prompt per book directions.


mysql> use mysql
database changed

mysql> insert into users values(
--> 'localhost',
-->'username',
-->Password('password'),
-->'Y','Y','Y','Y','Y','Y','Y',
-->'N','N','N','N','N','N','N','N','N','N','N',
-->'N','N','N','N','N','N','N','N','N','N');

RETURNS THIS:
ERROR 1136 (21S01): Column count doesn't match value count at row 1
mysql>


I have done some exploring and found out that this means there are more values listed than there are columns in the table.

My question is how do I find out how many columns there are in the table from the command line? This is suppose to an easy exercise just to make sure it works. haha I have been at this for almost 16 hours. I have not even d/l php yet.
Any help would be greatly appreciated!
Thanks in advance,
dink

#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#
run the command

describe users

for a column specification for table users

#3
dink

dink

    Newbie

  • Members
  • Pip
  • 2 posts
Thanks orjan!

I could not have done this with out your help. The textbook leaves out a lot of vital information for a newbie.
I finally got it to work by inserting field names and then the values for the fields that did not have default values.
INSERT INTO user
(Host,User,Password,ssl_cipher,x509_issuer,x509_subject) VALUES('localhost','myuser','mypassword','null','null','null');

There is no way I could have found this information on my own. It only took me 30 minutes to figure out the code you posted needed a semicolon to work. haha

Again thanks and I really appreciate your help.
Who knows maybe some day I can help some one.:D
dink

#4
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
+rep, orjan.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#5
sooshyboy

sooshyboy

    Newbie

  • Members
  • Pip
  • 1 posts
Hey, as you can see I'm new here and not sure if anyone will pick up this thread but i have exactly the same problem with exactly the same book! ive tried what orjan said but to no avail... im sure its going to be something simple... but im literally pulling my hair out! Please Help! heres a quick summary of where im at...

first problem... (Same as original post)

command line prompt per book directions.


mysql> use mysql
database changed

mysql> insert into users values(
--> 'localhost',
-->'username',
-->Password('password'),
-->'Y','Y','Y','Y','Y','Y','Y',
-->'N','N','N','N','N','N','N','N','N','N','N',
-->'N','N','N','N','N','N','N','N','N','N');

RETURNS THIS:
ERROR 1136 (21S01): Column count doesn't match value count at row 1
mysql>



SO I TRIED... The command

describe users;

and just get this...

Table 'mysql.users' doesn't exist


ARRGGH!

Please Help!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users