Re: case sensitivity of table names
At 12:22 -0500 12/17/03, Mayuran Yogarajah wrote: I am using case sensitive table names when I create tables like : CREATE TABLE MyTest; If I want to do a select from this table, I have to do SELECT * FROM MyTest, not SELECT * FROM mytest. How can I make it so that the table name is still MyTest but selects work with mytest ? You can set the lower_case_table_names server variable to 1. Then table names will not be treated as case sensitive, and you can write them in any lettercase in your queries. Two points to note, though: - Before setting the varable, rename all your tables to lowercase. Otherwise they won't be recognized properly when you set the variable. (The way it works is that if causes the server to lowercase the names of new tables when they are created.) - Although you will be able to refer to tables using any lettercase, *within a given query*, you must refer to the table consistently. See http://www.mysql.com/doc/en/Name_case_sensitivity.html for an example. -- Paul DuBois, Senior Technical Writer Madison, Wisconsin, USA MySQL AB, www.mysql.com Are you MySQL certified? http://www.mysql.com/certification/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: case sensitivity of table names
Paul DuBois wrote: At 12:22 -0500 12/17/03, Mayuran Yogarajah wrote: I am using case sensitive table names when I create tables like : CREATE TABLE MyTest; If I want to do a select from this table, I have to do SELECT * FROM MyTest, not SELECT * FROM mytest. How can I make it so that the table name is still MyTest but selects work with mytest ? You can set the lower_case_table_names server variable to 1. Then table names will not be treated as case sensitive, and you can write them in any lettercase in your queries. Two points to note, though: - Before setting the varable, rename all your tables to lowercase. Otherwise they won't be recognized properly when you set the variable. (The way it works is that if causes the server to lowercase the names of new tables when they are created.) - Although you will be able to refer to tables using any lettercase, *within a given query*, you must refer to the table consistently. See http://www.mysql.com/doc/en/Name_case_sensitivity.html for an example. Is it possible to change the variable lower_case_table_names from mysql commandline? I tried to change it by doing this : mysql SET lower_case_table_names=1; and got the error : ERROR 1193: Unknown system variable 'lower_case_table_names' Thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: case sensitivity of table names
At 13:00 -0500 12/17/03, Mayuran Yogarajah wrote: Paul DuBois wrote: At 12:22 -0500 12/17/03, Mayuran Yogarajah wrote: I am using case sensitive table names when I create tables like : CREATE TABLE MyTest; If I want to do a select from this table, I have to do SELECT * FROM MyTest, not SELECT * FROM mytest. How can I make it so that the table name is still MyTest but selects work with mytest ? You can set the lower_case_table_names server variable to 1. Then table names will not be treated as case sensitive, and you can write them in any lettercase in your queries. Two points to note, though: - Before setting the varable, rename all your tables to lowercase. Otherwise they won't be recognized properly when you set the variable. (The way it works is that if causes the server to lowercase the names of new tables when they are created.) - Although you will be able to refer to tables using any lettercase, *within a given query*, you must refer to the table consistently. See http://www.mysql.com/doc/en/Name_case_sensitivity.html for an example. Is it possible to change the variable lower_case_table_names from mysql commandline? I tried to change it by doing this : mysql SET lower_case_table_names=1; and got the error : ERROR 1193: Unknown system variable 'lower_case_table_names' No, it must be set at startup time. Besides, if you set it with a SET statement, the value would be lost the next time you start the server. Best to put it in an option file so that it's used each time the server starts up: [mysqld] lower_case_table_names=1 -- Paul DuBois, Senior Technical Writer Madison, Wisconsin, USA MySQL AB, www.mysql.com Are you MySQL certified? http://www.mysql.com/certification/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]