2 messages in com.mysql.lists.bugsfederated tables structure not replic...| From | Sent On | Attachments |
|---|---|---|
| Giuseppe Maxia | 29 Sep 2005 08:31 | |
| Miguel Angel Solorzano | 03 Oct 2005 11:45 |
| Subject: | federated tables structure not replicable![]() |
|---|---|
| From: | Giuseppe Maxia (g.ma...@stardata.it) |
| Date: | 09/29/2005 08:31:48 AM |
| List: | com.mysql.lists.bugs |
federated tables structure not replicable
Description:
In MySQL 5.0.13 a change for federated tables was made, to move the connection string from COMMENT to CONNECTION. While this works, federated tables now can not be backed up since "SHOW CREATE TABLE" does not include the CONNECTION string.
How-To-Repeat:
try using the output of SHOW CREATE TABLE federated_table_name \G to create a new table. Or try this: $ mysqldump --no-data -h host1 database_name federated_table_name | \ mysql -h host2 database_name
Fix:
No direct workaround.
When creating a federated table, add a COMMENT with the connection
string,
and then you can do something like
$ mysqldump --no-data -h host1 database_name federated_table_name | \ perl -pe 's/\bCOMMENT\s*=\b/CONNECTION=/' | \ mysql -h host2 database_name
Notice that, if you have enough privileges to access the .frm file, you can get
the
connection string with a regexp:
$ perl -lne 'print $1 if m{(mysql://[^/]+\@[^/]+/[^/]+/\w+)}'
/datadir/dbname/fed_table.frm
mysql://user:pass@192.168.2.64:3306/r_db/r_table
regards
GM
-- Giuseppe Maxia CTO http://www.StarData.it MySQL Certified Professional




