Link to home
Start Free TrialLog in
Avatar of antum
antum

asked on

Using old data dir in new installation

Hi

I had some trouble getting mysql re-installed, and when I did it has started to use a new data directory that contains the default databases. Now I have my old databases trapped in a folder, I tried to overwrite the new folder with the old folder but then the mysql service wouldn't start.

So is there some way for me to get the old databases into my new installation?

I am running Windows XP Pro 2003 all the latest updates, MySQL Server 4.1 (I think I used to have 4.0.25) is this going to be a problem?

Thanks for your help,
:Ant
Avatar of todd_farmer
todd_farmer
Flag of United States of America image

It's strongly recommended that you export your data in mysqldump from the old installation and import it into the new version.  There is no guarantee that the binary data files are compatible across versions.

One big change between 4.0 and 4.1 is the password hashing algorithm changed, which impacts the mysql account tables.

Is loading the data from a mysqldump backup not an option?  It sounds like maybe the 4.0 installation is gone now.
It seems likely that the reason your server doesn't start is because of the password hashing issue or some other incompatibility between the versions.  Can you check the server error log (should be found at [mysql_home]/data/[host_name].err, where [mysql_home] is the MySQL installation directory and [host_name] is the machine name.
Avatar of antum
antum

ASKER

Can I generate a mysql dump from a data directory or does it have to be a running server?

Thanks,
:Ant

I had a look in the log file but there is no mention of the error, i think i might have re-installed after the first time I received that error
mysqldump has to be executed against a running server.

So, before we go any further, do you have a working installation of MySQL right now?  Just without the data from the old installation?  Let's check that before we make any changes.
Avatar of antum

ASKER

yeah, i have it working as a fresh install.. the old data is in a backup directory it is the entire contents of the mysql/data dir.

I managed to just copy all the folders across to the new mysql/data dir and it looks as if they are all there (mysql -u root -p then SHOW DATABASES;)

But I can't connect to the mysql server using php.. I still get a "Can't connect to MySQL server on 'localhost' (10013)" Even though I can from the command line.

Any help is appreciated,
Thanks,
:Ant
OK, the php probably relies on a specific account being created that doesn't yest exist in the new installation, or it could be an issue related to the password hashing algorithm:

http://dev.mysql.com/doc/refman/5.0/en/old-client.html

When you are connected on the command-line using the root account, can you verify whether the php-required account exists?
Avatar of antum

ASKER

I'm testing the php with the root account so I know it exists.. but yes it could be the hashing thing.

Is it safe to set the root password to the old style?

Note: this is just for my development tests...

thanks,
:Ant
ASKER CERTIFIED SOLUTION
Avatar of todd_farmer
todd_farmer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of antum

ASKER

Hi,

Ok so i turned off the firewall and all is happy.!!

grrr...

so how do I have the firewall going and my dev. environment?

Thanks for your help!!
You have to build an exception for it.  I can't provide step-by-step instructions on how to do that, but I bet somebody in the WinXP topic area can.
Avatar of antum

ASKER

Thanks for your help!
And thanks for the points!