Posts Tagged ‘mysql gotchas’

MySQL: my.ini Gotcha on Windows

By Augusto Bott October 14th, 2008 at 11:15 am
Posted in MySQL
Tags:

The other day we began to encounter weird and random errors on small and innocent queries that shouldn’t give any errors at all. It all lead to one of our most basic health checks failing for no apparent reason.

The first clue that popped into our minds was related to case-sensitivity, since the failing check was looking for the column names of the only table in the schema with UPPER CASE name. This symptom was especially weird since all of this was happening on MySQL setups running on Windows, and so we’re not sure if this was being caused by some internal code library, MySQL, or Windows itself.

Since that was the only clue we then had, it seemed obvious that we should start fiddling with the lower_case_table_names system variable. After a couple of restarts, this approach was leading us nowhere, so we finally gave up on it.

Then, we had the brilliant idea of actually executing that statement by hand on the command line to see what happened:

C:\pythian>mysql -uXXXX -p XXXX -e "desc TABLE_NAME"
Enter password: *****
ERROR 1 (HY000) at line 1: Can't create/write to file 'C:\MySQL      mp\#sql_634_0.MYI' (Errcode: 22)

C:\pythian>perror 22
OS error code  22:  Invalid argument

C:\pythian>

None of us remembered seeing this one before, so we stared at the monitor for a few moments, not realizing the meaning of this message. I guess our focus on the case-sensitivity was driving us away a from the real cause. So . . .  time to check the my.ini file. (more…)

SHOW VARIABLES Shows Variables MySQL Does Not Know About

By Sheeri Cabral January 8th, 2008 at 3:31 pm
Posted in Group Blog PostsMySQL
Tags:

The listing of Dynamic System Variables on the MySQL Reference Manual’s page is supposed to show those variables you can change on-the-fly.

innodb_data_home_dir is listed there as a dynamic variable, but it is not one, and trying to change it on-the-fly doesn’t work:

mysql> set global innodb_data_home_dir="/data/mysql/data";
ERROR 1193 (HY000): Unknown system variable 'innodb_data_home_dir'

mysql> set session innodb_data_home_dir="/data/mysql/data";
ERROR 1193 (HY000): Unknown system variable 'innodb_data_home_dir'

The same goes when trying to use SET @@innodb_data_home_dir, and with log-slow-queries (changed to log_slow_queries as a parameter, of course). The irony is that innodb_data_home_dir shows up when SHOW VARIABLES is issued — so SHOW VARIABLES shows variables that MySQL is not aware of.

The link at the top is a link to the 4.1 version of the manual, just in case folks are thinking I’m using a newer manual version. Mind you, I have this problem with 5.0.45 as well as 4.1.20.

And of course the manual specifies, “The last column indicates for each variable whether GLOBAL or SESSION (or both) apply.” Which seems to be untrue.