Jane ...
(This is based on our own experience, and info found in the MySQL Manual
... http://www.mysql.com/doc/N/a/Name_case_sensitivity.html). We have used
this procedure to convert dozens of databases, and found that setting the
server's variable to lower-case tables also requires converting the
tables/columns themselves with an ALTER query.
(1) Create a copy of the database so you have a backup in case something
goes wrong ...
mysqldump -u{username} -p -c dbname>dbname.sql
(2) Create a working script which you can edit to create your ALTER queries
...
mysqldump -u{username} -p -d dbname>alterdbname.sql
(3) Open MY.INI (or MY.CNF) in a text editor, and under [mysqld] ...
set-variable = lower_case_table_names=1
(4) Edit the script to ALTER the tables and columns. Use the text editor of
your choice (I use either CodeWhiz or NoteTab Pro) to open alterdbname.sql
The example below uses a database called sampledata, which has one table
(TableName), which is turn has two columns (RecNo and Name).
USE sampledata;
ALTER TABLE TableName RENAME TO tablename;
ALTER TABLE tablename CHANGE Recno recno int(11) NOT NULL auto_increment;
ALTER TABLE tablename CHANGE Name name varchar(100) default NULL;
The ALTER scripts we have written to convert our databases to lower-case
includes the complete definitions and table options (used to CREATE the
table and columns) as alter specs.
If you are not familiar with the syntax for ALTER, go to the MySQL Manual
(http://www.mysql.com/doc/A/L/ALTER_TABLE.html)
If you are not familiar with the syntax for CREATE, go to the MySQL Manual
(http://www.mysql.com/doc/C/R/CREATE_TABLE.html)
(5) Run the ALTER script against your database ...
mysql -u{username} -p dbname<alterdbname.sql
(6) Restart the MySQL server ... I believe parameter changes in MY.INI (or
MY.CNF) are read when the server starts.
Good luck.
-----Original Message-----
From: craig riley [SMTP:[EMAIL PROTECTED]]
Sent: Wednesday, July 04, 2001 2:15 AM
Subject: RE: Windows 2000 MySQL case sensitive?
Hi Gerald,
There wasn't a my.cnf so I ran winmysqladmin.exe which did indeed
create a my.ini - this contained the following:
#This File was made using the WinMySQLadmin 1.0 Tool
#7/4/2001 5:09:26 PM
#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions
[mysqld]
basedir=C:/mysql
#bind-address=10.14.1.5
datadir=C:/mysql/data
#language=C:/mysql/share/your language directory
#slow query log#=
#tmpdir#=
#port=3306
#set-variable=key_buffer=16M
[WinMySQLadmin]
Server=C:/mysql/bin/mysqld-nt.exe
user=mysql
password=password
What should I add to make the uppercase tablenames work?
Appreciate the help
Jane
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php