I've found several scripts, similar to this below, online that gives a preview how all table names gonna look like once I fire the script:
select concat('RENAME TABLE ', TABLE_NAME, ' TO ', UPPER(TABLE_NAME), ';') from information_schema.TABLES where TABLE_SCHEMA = 'your_db'
But what I need is an upgrade script that actually updates the the table names in the db, and not just let me preview the names.
I'm aware of these buddies:
lower_case_table_names = 1
lower_case_file_system = 1
but this in not an option due to the fact that I cannot make changes in the .ini file on my domain - so rather than have to rename each table online I prefer an simple script that renames (and saves) all table names at once... - and how would such update-script look like...?
I had similar problems when my hosting company moved MySQL database from Windows to Linux, had to change all tables names to uppercase:
First run this in the SQL
window of phpmyadmin
select concat('rename table ', table_name, ' to ' , upper(table_name) , ';') from information_schema.tables where table_schema = 'your_schema_name';
this produces a script that will change all tables names to uppercase copy the script and paste it into the SQL
window and run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With