1

At beginning we had application running perfectly on centos 6 , Since some updates were needed on the server, We had to re-install softwares and packages on the server and use the application files from last backup we had.

Having trouble to access tables: If I run SHOW TABLES ; all tables are shown but if I try to query any of them e.g: SELECT * FROM Users; I get this error ERROR 1146 (42S02): Table 'myDatabaseName.Users' doesn't exist

I also checked this answer which suggests to have ib* files in the root of the MySQL datadir (e.g. ibdata1, ib_logfile0 ib_logfile1) , in my case it seems to be in the right place and changing permission on mydatabase folder chmod -R 660 myDatabaseName and I did that

In my MySQL datadir I have the followings: myDatabaseName, ibdata1 , ib_logfile0, ib_logfile1 , mysql , mysql.sock , performance_schema

Looking forward to hearing from you. Thanks

Community
  • 1
  • 1
ikuchris
  • 1,162
  • 1
  • 15
  • 33
  • 1
    `SELECT * FROM Users;` are you sure your table name is `Users` not `users` ? – Tomasz Aug 27 '15 at 13:09
  • @TomaszTurkowski sure the table name is Users , looking forward to hear what you can help , thanks – ikuchris Aug 27 '15 at 13:12
  • https://stackoverflow.com/questions/6128286/innodb-tables-exist-in-mysql-but-says-they-do-not-exist-after-copying-database-t?rq=1 hope that helps – Surya Aug 27 '15 at 13:13
  • according to 'myDatabaseName.Users' doesn't exist, the table Users may not be existing –  Aug 27 '15 at 13:15
  • Once check with `SHOW TABLES;` – phpfresher Aug 27 '15 at 13:16
  • @TomaszTurkowski But do you agree that SQL is case insensitive? In which case, both `SELECT * FROM Users;` and `SELECT * FROM users;` are equivalent. – Racil Hilan Aug 27 '15 at 13:20
  • did you success to do SELECT on another table – Mohammad Alabed Aug 27 '15 at 13:22
  • @RacilHilan yes I agree it's case sensitive. Not sure if it depends on configuration, but in my cases it is. If I will try to query select from (capitalised name of table) I'm getting table doesn't exist. – Tomasz Aug 27 '15 at 13:24
  • @phpfresher still the table is shown – ikuchris Aug 27 '15 at 13:28
  • @RacilHilan sure my is case sensitive too – ikuchris Aug 27 '15 at 13:29
  • Hii.. i think may be ur connected to another database... once check it.. Once i did like that... I connected to a database and tried to fetch the data from a table in another database... Once check it... – phpfresher Aug 27 '15 at 13:31
  • @TomaszTurkowski and ikuchris what OS do you use? The standard SQL is case insensitive, but in MySQL case: Unix based are case sensitive while Windows and OSX are not. Here is a link from MySQL docs: https://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html. I personally use all-lower-case for database identifiers to avoid any issue. – Racil Hilan Aug 27 '15 at 14:12
  • @RacilHilan u're right locally I use OSX and is not case sensitive as you said while on production server I use centos and is case sensitive – ikuchris Aug 27 '15 at 14:18
  • @RacilHilan +1 locally i have OSX but on vm I'm using ubuntu and there's case sensitive. – Tomasz Aug 27 '15 at 14:25

1 Answers1

0

Finally solved the problem by uninstalling and install again mysqlServer and taking the entire mysql directory /var/lib/mysql content from my backup to the new directory , and I have all tables and data accessible

ikuchris
  • 1,162
  • 1
  • 15
  • 33