jrharshath
jrharshath

Reputation: 26583

mysql "table does not exist"

I have a database called bmto with a table users in it. I used the root user to create the table, but a different user bmto_user to use it.

Problem is, when I try to insert something in the users table, it gives me an error saying "Table 'bmto.USERS' doesn't exist". Same error from php, and from command line. I've even tried inserting as root, but no luck.

Any ideas?


OKAY, I just noticed: mysql is case sensitive. USERS doesn't exist of course, 'users' does! Silly me. Please help me close this question.

Thanks :)

Upvotes: 3

Views: 2901

Answers (3)

Thilo
Thilo

Reputation: 17735

Try adding this permission as root:

GRANT USAGE ON `bmto`.* TO 'bmto_user'@'localhost'

Also make sure to use lower case for the table name in your query - some OS are picky about that.

Upvotes: 0

duffymo
duffymo

Reputation: 308743

When I experience behavior that conflicts with my assumptions, I check my assumptions.

Be certain that your application is connecting to the same database that you used to create the table.

Take a look at this: http://dev.mysql.com/doc/refman/5.0/en/cannot-find-table.html

Upvotes: 1

itsols
itsols

Reputation: 5582

If you're on Linux flavours, tables are strictly case sensitive.

So make sure you give it in the EXACT way you defined it. Based on your question, I believe they've got to be all lower case.

Upvotes: 1

Related Questions