48 users online (1 members and 47 guests)  


  Results 1 to 6 of 6

Related

  1. Replies: 1
  2. Replies: 2
  3. How to connect to database mysql    Forum: Databases
    Replies: 1
  4. Connecting to Mysql Database    Forum: Databases
    Replies: 3
  5. Clearing out MYSQL database?    Forum: PHP Forum
    Replies: 3
  1. #1
    Sunburned's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2005
    Posts
    2

    Restoring MySQL Database After Crash

    I'm just getting started with PHP and MySQL. I had a problem with my MySQL server, and I had to reinstall it. I wasn't able to do a dump of the data before the server crashed, but I did copy the "data" folder and the folder containing the Inno DB files from my hardrive. I have now reinstalled MySQL, but when I try to replace those folders, I am no longer able to log into the server, even as the root user. I did not reinstall the former "mysql" folder with the old user tables, and I also used the same passwords as I did on the former MySQL install so I don't think that is the problem.

    How do I restore the databases from the old server? Is there a utility I can use to restore the databases and tables from the files in the data and InnoDB folders I copied?

    I am running MySQL Server 4.1 on a Windows 2000 Machine. I only had 2 databases on my old server, and they were fairly small in size.

    Thanks for any info,

    The Sunburned Surveyor

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hiya, welcome to the forums.

    As you didn't reinstall the users priviliges tables, have you tried the default mysql login (root with a blank password)?
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Sunburned's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2005
    Posts
    2
    QuietDean,

    Thank you for the welcome.

    After a re-install of MySQL I can log in with the root user, and with any other user accounts that I create.

    However, I thought I could restore my 2 databases by simply replacing the "data" folder and InnoDB folder from my re-install with the same folders from my MySQL install before the crash.

    Once I replace the folders I can no longer log into MySQL, even as the root user.

    My Question really should be "How do I restore my databases to a new install of MySQL if all I have is a copy of the "data" folder and the InnoDB folder from the old MySQL intallation?"

    I thought I could just replace the folders, but I think there may be something more involved.

    Thanks for your help.

    The Sunburned SUrveyor

  4. #4
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    You must have the tables in order to upload the data correctly.

    Why this is messing with your login I cannot say for sure.

    Dave

  5. #5
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hmm.

    I'm not sure if this is going to work, but try

    Fresh Install
    Replace the data but without the mysql directory thats inside it
    Try default logon

    You will probably have to set up priviliges again.

    For future reference, mysqldump is the preferred way of backing up your databases. Also phpMyAdmin has a very good export.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  6. #6
    abin's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2009
    Posts
    1

    Re: Restoring MySQL Database After Crash

    I hope after fresh installation of php and mysql you first stop mysql via services and replace datafilder contain all your previous database and tables then start mysql and try to login if you have root password first remove that



Tags for this Thread