Thank you everyone for your solutions.
I have found one, which may be of use to you.
It relies on the ability to rename a table from one database to another:
mysql> rename table old_db.tabname to new_db.tabname
You would first need to drop all triggers, then recreate them.
So, I placed these commands In a shell script:
old_db=$1;
new_db=$2;
mysql -B $old_db -e "show tables" | tail -n +2 | perl -pe "s/^(.*)$/
rename table $old_db.\1 to $new_db.\1;\n/" | mysql
Shuly.
On Apr 7, 2009, at 4:40 AM, Ding Hao wrote:
hi,
I have a solution. Please my blog's http://www.fire9.cn/?p=132.
good luck.
-------------------------------------------------------------
Ding Hao/Fire9 DB Architect
Email&msn>alk: fire9di...@gmail.com
My Blog:http://www.fire9.cn
My Twitter: http://twitter.com/fire9
在 2009-4-7,上午12:20, Shuly Avraham 写道:
Hi,
I need to rename a database having InnoDB tables.
MySQL version is: 5.0.24-standard - so I cannot use the
'mysqladmin rename' option.
What would be the best approach for doing this?
Thanks,
Shuly.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?
unsub=fire9di...@gmail.com
Shuly Avraham
Gramene.org & Plantontology.org
CSHL Ware Lab
sh...@cshl.edu
_______________________________________________
Warelab mailing list
ware...@brie4.cshl.edu
http://brie4.cshl.edu/mailman/listinfo/warelab