简体   繁体   中英

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:)

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM