On 6/8/06, murthy gandikota <[EMAIL PROTECTED]> wrote:

I've checked the dump file I created with mysqldump on a database sfg, and
it has statements like the following:

DROP VIEW IF EXISTS `advAPI`;
CREATE ALGORITHM=UNDEFINED VIEW `sfg`.`advAPI` AS select
`sfg`.`advertiser`.`advertiserid` AS
`advertiserid`,count(`sfg`.`cust`.`custid`) AS `api` from
(`sfg`.`advertiser` left join `sfg`.`cust` on((`sfg`.`cust`.`advertiserid` =
`sfg`.`advertiser`.`advertiserid`))) where (`sfg`.`cust`.`statusCurrent` in
(20,21,22,23)) group by `sfg`.`advertiser`.`advertiserid`;

Now if I want to import this dumpfile into another database sfgbackup, it
won't work because the sql is referring to sfg database. I think this is the
reason why I'm facing the problems (sorry for multiple threads). Can anyone
confirm my suspicion and suggest a fix? I'm thinking manually changing all
the entries. Is that the only way?

Thanks for your help
Murthy

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Your problem has to do with a DB rename ...read on ...
The easiest way to rename a database as far I know is
1) shutdown Mysql
2) Go to your data directory,
3) make a recursive copy (with permissions intact) of database "sfg", call
it "sfgtemp"
4) rename the newly copied directory "sfgtemp" to "sfgbackup"
5) restart mysql
6) do some GRANT etc to make sure that the users have proper access to the
new database
sfgdump...
7) now you have a new database sfgdump !!!if thats not what you want then
just repeat your dump and restore on sfgdump freshly instead of sfg....

Give this a try and see how it goes ....

Kishore Jalleda
http://kjalleda.googlepages.com/projects

Reply via email to