Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My Windows box died after I developed a database in xampp on it; fortunately I have a backup of the entire F:/TestWeb/Xampp partition. Unfortunately, I did not do an Export (nor dump) of the "Lws2" database before the crash. I have replaced the defunct machine with one running Mint7 (based on Ubuntu 9.04 "Jaunty Jackalope") and installed xampp-linux into the /opt partition, so the new xampp now runs fine in /opt/lampp, and says all the elements are secured by passwords (which I just assigned during this installation.)

I assumed that Xamp-Windows installed in November would migrate easily to xampp-linux installed iin February -- a bad assumption. It apparently would have been simple if I had known enough to do an Export or a Dump before the crash, but....

The backup was done to a Network Attached Storage drive, which is formatted as "vfat" so the backup does not carry with it any valid ownership permissions from MySql on NTFS.

I now see from my backup that the old data resided in \TestWeb\Xampp\Mysql\Data\Lws2\ and consists of 7 ".frm" files which define my tables. The actual data -- I suppose a ".sql" file or files -- has disappeared, and I am resigning myself to two days of retyping it. But I do not wish to do the table layouts all over again.

So I copied Data tree to /opt/lampp/Data -- PhpMyAdmin does not see it.
So I copied Lws2 tree to /opt/lampp/Lws2 -- PhpMyAdmin does not see it.

So I copied Data tree to /opt/lampp/var/mysql/Data -- PhpMyAdmin does not see it.
So I copied Lws2 tree to /opt/lampp/var/mysql/Lws2 -- PhpMyAdmin does not see it.

So I adjusted all the permissions to stop saying owner "nobody" to owner "root" and gave full permissions to all groups and to all others, with permissions percolating down, in all 4 trees. You guessed it -- PhpMyAdmin does not see any database named Lws2, only its 4 default ones. I double-checked the permissions and rebooted Linux and repeated the tests.

At some point in that process I did see PhpMyAdmin showing "lws2(7)" but when I clicked on it I saw a "no table found" message. I have not been able to recreate that experience.

Apparently there are some setup files for MySql and for PhpMyAdmin which need to be set up by running a wizard or two or by editing the files directly. I grepped the TestWeb tree and found an old "ldir = "C:TestWeb\Xampp\MySql\" and a "DataDir = C:TestWeb\Xampp\MySql\" in a .php file and in a .bat file, but I cannot find the corresponding config file names on the /opt partition/ -- so it looks as if these wizards have not been run to create them. What config files files does Linux use to setup MySql config files for PhpMyAdmin?

What wizards do I need to run to point the MySql engine and the PhpMyAdmin at the folder /opt/lampp/data/ with its lws2 folder inside it? Or which files do I need to edit, with a sample of what it normally says under Linux?

Incidentally, I remember I converted from MyISAM with its .MYD and .MYI files to InnoDB after entering only a small amount of the data -- and I do not know what file types to look for -- perhaps my data is still there but under another guise or in another place?

Is it something as simple as linux needing to see "/data/" instead of /Data? I will check that out while waiting for a response. If anyone can point me to documentation that discusses this level of detail -- I will read it avidly!

In any case, thanks for any clarification you can give on this thorny problem.

wizdum

share|improve this question

4 Answers

this post is already some months old. Nevertheless I would like to share my knowledge for people who aren't able to start their xampp any longer but still have access to the data directoy located in xampp/mysql/data/ I exactly had this problem: My Windows doesn't startup any longer due to some weird configuration problems. I took this chance to say goodbye to Windows and installed Linux.

Then I installed mysql-server on linux (stop your server if you have one currently running). I mounted my Windows harddisk, located the mysql data directory (which is xampp/mysql/data/ if using xampp). This dir contains one folder for each db table; each folder containing .frd, .MYD and .MYI files. Let's say you want to restore the table "shop" on linux. Simply copy the folder xampp/mysql/data/shop to /var/lib/mysql/shop (if your linux mysql data directory is /var/lib/mysql as it is on Ubuntu). Start your mysql server. Nothing more to do! Open phpmyadmin and your shop table shows up!

It's that easy!

share|improve this answer

This is indeed a thorny problem, and the sort of job you'll probably need a certified MySQL engineer to help you with. Otherwise, I'd recommend:

  • Linux: ensuring you are running the same version of MySQL server (critical)
  • Test from the command line client rather than PHPMyAdmin - you'll get more verbose error reporting
  • Check /var/log/mysql to see what errors the engine is reporting at startup (restart if necessary) - the data could be corrupt, or just not present
  • Try installing the same XAMPP package on a Windows machine and copying your F:\TestWeb\Xampp data over it from DOS (i.e. before Windows starts) - this should recreate the environment that the dump came from (try and keep this all in Windows file formats too, copying to a Linux partition and back again could have unintended consequences)
  • Otherwise, if you have an incomplete or damaged backup, it's likely you're going to have to pay for recovery, or just retype the lot (you know you can CSV import into PHPMyAdmin from Excel etc?).
share|improve this answer

If you have Innodb tables in your database then, you will have a problem. The innodb tables can not be moved from one to another

share|improve this answer

from xampp/mysql/data in win copy your data base Dirs to

/opt/lampp/var/mysql (lunux xampp installation)

now for every database dir do:

chown -R :root mydatabasefromwin

chmod -R 777 mydatabasefromwin

(or chmod -R 700)

this worked for me. Have in mind that table names in windows by default are small caps! To rename this to My_Table_Name use Métamorphose ( http://file-folder-ren.sourceforge.net/index.php?page=Download )

for standard lamp server setup, dir with db files should be in:

/var/lib/mysql
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.