This is a discussion on Backup MySQL databases from hard disk without running instance within the MySQL forums, part of the Database Server Software category; --> Hi all, My server crashed recently and I now only have access to the hard disk. This means that ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi all, My server crashed recently and I now only have access to the hard disk. This means that I can't do a MySQL dump to backup my data. Can I still backup my data, if yes, how? Thanks in advance! Dan |
| |||
| > My server crashed recently and I now only have access to the hard > disk. This means that I can't do a MySQL dump to backup my data. Can I > still backup my data, if yes, how? Under Windows, I found that you can copy the old tables (data directory) to a fresh MySQL installation and just continue working with it. Best regards -- Willem Bogaerts Application smith Kratz B.V. http://www.kratz.nl/ |
| |||
| On Mar 16, 11:04 am, Willem Bogaerts <w.bogae...@kratz.maardanzonderditstuk.nl> wrote: > > My server crashed recently and I now only have access to the hard > > disk. This means that I can't do a MySQL dump to backup my data. Can I > > still backup my data, if yes, how? > > Under Windows, I found that you can copy the old tables (data directory) > to a fresh MySQL installation and just continue working with it. > > Best regards > -- > Willem Bogaerts > > Application smith > Kratz B.V.http://www.kratz.nl/ I just tried what you suggested, and it didn't work really. The databases show up, and when I use SHOW TABLES, the tables are also shown. But as soon as I try to see the content of them (SELECT * FROM mytable), it tells me that the tables doesn't exist. Any fixes for this? Thanks again, Dan |
| |||
| "Dan Soendergaard" <dan1990@gmail.com> wrote: > On Mar 16, 11:04 am, Willem Bogaerts >> >> Under Windows, I found that you can copy the old tables (data directory) >> to a fresh MySQL installation and just continue working with it. This works for all operating systems, not just Windows. > I just tried what you suggested, and it didn't work really. The > databases show up, and when I use SHOW TABLES, the tables are also > shown. But as soon as I try to see the content of them (SELECT * FROM > mytable), it tells me that the tables doesn't exist. Seems the tables are InnoDB tables and you did not copy the InnoDB tablespace files (and logs) as well. XL -- Axel Schwenke, Support Engineer, MySQL AB Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/ MySQL User Forums: http://forums.mysql.com/ |
| |||
| On Mar 16, 11:33 am, Axel Schwenke <axel.schwe...@gmx.de> wrote: > "Dan Soendergaard" <dan1...@gmail.com> wrote: > > On Mar 16, 11:04 am, Willem Bogaerts > > >> Under Windows, I found that you can copy the old tables (data directory) > >> to a fresh MySQL installation and just continue working with it. > > This works for all operating systems, not just Windows. > > > I just tried what you suggested, and it didn't work really. The > > databases show up, and when I use SHOW TABLES, the tables are also > > shown. But as soon as I try to see the content of them (SELECT * FROM > > mytable), it tells me that the tables doesn't exist. > > Seems the tables are InnoDB tables and you did not copy the InnoDB > tablespace files (and logs) as well. > > XL > -- > Axel Schwenke, Support Engineer, MySQL AB > > Online User Manual:http://dev.mysql.com/doc/refman/5.0/en/ > MySQL User Forums: http://forums.mysql.com/ The tables are InnoDB, yes. I located a directory called "InnoDB" in the MySQL directory. It contained one file which I copied to the new MySQL installation. I then copied the whole "Data" directory to the new installation too, but I get the same result. Are the InnoDB tablespace files and logs located somewhere else? Should I copy anything else to get it to work? Dan |
| |||
| "Dan Soendergaard" <dan1990@gmail.com> wrote: > On Mar 16, 11:33 am, Axel Schwenke <axel.schwe...@gmx.de> wrote: >> >> Seems the tables are InnoDB tables and you did not copy the InnoDB >> tablespace files (and logs) as well. > > The tables are InnoDB, yes. I located a directory called "InnoDB" in > the MySQL directory. It contained one file which I copied to the new > MySQL installation. I then copied the whole "Data" directory to the > new installation too, but I get the same result. Are the InnoDB > tablespace files and logs located somewhere else? Should I copy > anything else to get it to work? This is all configurable. Get the my.ini file from the old installation and check the innodb_data_home_dir, innodb_data_file_path and innodb_log_group_home_dir variables for where to find the data files and logs. If there are nonstandard settings in my.ini, you have to copy them to the new my.ini. Default is to have none of those settings in my.ini. Then everything is located in datadir = $INSTALLDIR/Data. There should be files ibdata1, ib_logfile0 and ib_logfile1. Oh - and use the *exact* same version of MySQL. XL -- Axel Schwenke, Support Engineer, MySQL AB Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/ MySQL User Forums: http://forums.mysql.com/ |
| ||||
| On Mar 16, 12:44 pm, Axel Schwenke <axel.schwe...@gmx.de> wrote: > "Dan Soendergaard" <dan1...@gmail.com> wrote: > > On Mar 16, 11:33 am, Axel Schwenke <axel.schwe...@gmx.de> wrote: > > >> Seems the tables are InnoDB tables and you did not copy the InnoDB > >> tablespace files (and logs) as well. > > > The tables are InnoDB, yes. I located a directory called "InnoDB" in > > the MySQL directory. It contained one file which I copied to the new > > MySQL installation. I then copied the whole "Data" directory to the > > new installation too, but I get the same result. Are the InnoDB > > tablespace files and logs located somewhere else? Should I copy > > anything else to get it to work? > > This is all configurable. Get the my.ini file from the old installation > and check the innodb_data_home_dir, innodb_data_file_path and > innodb_log_group_home_dir variables for where to find the data files > and logs. If there are nonstandard settings in my.ini, you have to copy > them to the new my.ini. > > Default is to have none of those settings in my.ini. Then everything is > located in datadir = $INSTALLDIR/Data. There should be files ibdata1, > ib_logfile0 and ib_logfile1. > > Oh - and use the *exact* same version of MySQL. > > XL > -- > Axel Schwenke, Support Engineer, MySQL AB > > Online User Manual:http://dev.mysql.com/doc/refman/5.0/en/ > MySQL User Forums: http://forums.mysql.com/ Got it to work now, incredible! I guess it was because I had downloaded the most recent version of MySQL. Thank you a lot to both of you! Regards, Dan |