After WAMP update & migrate, mysql tables have no structure / primary keys - mysql

We've moved WAMP to another drive on our server - the old version was WAMP 2.4, and the new one is WAMP 2.5. We installed 2.5 fresh on the new drive, and copied the www and mysql data folders from the old install.
It's 'working' - sites appear to run fine - but I've discovered that the database structure appears to be gone. All database tables have no primary keys, and no visible structure in phpMyAdmin.
This is the case for databases brought into the new WAMP install in the mysql data folder as well as new databases: I can export a database with structure from a remote server, but after importing to the local WAMP server the structure is stripped.
Two questions:
(How) can the database structure be restored?
How can I create or import new databases with structure?

Curiously this sorted itself out after attempting to troubleshoot the issue then undoing changes. What we tried:
Restarted all WAMP services, exited and reopened WAMP - unsuccessful.
Copied entire old mysql folder to new WAMP install, attempted to run mysql service with old mysql version - unsuccessful.
Reverted to newer version of mysql that came with WAMP 2.5 (back to initial state before troubleshooting), restarted services - unsuccessful.
Waited 10 minutes - table structure returned, working correctly.
This leads me to believe there was an interaction with another process or condition on the server, rather than a misconfiguration of WAMP.

Related

How to properly restore data from an old XAMPP data backup

I installed XAMPP on my PC and been working for ages on a project that I was just about to wind up. A few days ago, I tried to rename one of the databases but ended up with a database connection error. I made a backup of the entire XAMPP folder but been unsuccessful on the restoration, 5 days now and I'm panic-stricken. I deleted the new data folder and replaced with the old data folder but still in vain.
I have the same version of XAMPP for the old and new installations. Also, I stopped Apache and MySQL first before replacing the data folder.
The database tables are present but the data is missing. When I click the table, I get an error - #1932 - Table 'north.wp_terms' doesn't exist in engine. I am literally at crossroads at this point. I am quite frankly new to XAMPP I would have been more careful. I can upload the required files online for troubleshooting, if requested.

How to restore mysql database in XAMPP

I have been using XAMPP on Ubuntu for a while and I had created a DB via phpMyAdmin with a single DB and multiple rows.
After having to restart my PC, I could not restart XAMPP, so I did install it again (ran the installed.sh without installing first)
Installation was successful and web server is working fine with old files retained.
But, I find that I cannot access the table any more, even though I see it listed via phpMyAdmin and gives an error "Table does not exists in the engine".
However, I can see the table.ipd, table.frm and db.opt inside /opt/lampp/var/mysql/
Is there a way to restore the table from the XAMPP stack?

Some database content disappeared after WAMP reinstallation

I screwed up the config files for Apache
I reinstalled(without any uninstall) the WAMP in same folder but instead of 2.4 I did 2.5, so WAMP failed gloriously afterward.
I can not access WAMP anymore, so I can not backup my DBs from PHPMyAdmin (any hint about how to do backup in this senario will be helpful)
I copy the whole /wamp folder content (after screwed up the install).
I installed the 2.4 version Now WAMP running All DBs are still listed there But when I accesss two of the WP sites, they ask me to create a new site title, but not allow me to set username (says"User(s) already exists.").
Now I went back PHPmyAdmin and found the db for that WP site is EMPTY
I wonder how can I retrieve the good database information stored in that original /wamp folder backup, somehow, transfer into the new one, so that the db table that is EMPTY will populate with the original data again?
Thank You
Probably the safest way to recover is to:
Stop WAMPServer.
Copy the old MySQL folders to the new install of WAMPServer
So thats
copy \wamp_backup\bin\mysql\mysql(old version) to \wamp\bin\mysql\
Start WAMPServer again.
Now in the menu
Wampserver -> MySQL -> Version
you should see you old mysql version and the new one that came with the new install as well.
Switch to the old version by clicking on the old version number on that menu.
Wamp shoud now switch from the new MySQL to the old. Wait for WAMPServer to go green again.
Check the Mysql error log, to see if anything unpleasant has happened, if not,
You can then use phpmyadmin, or whatever tool you are used to to backup your missing databases.
Then switch back to the new version of MySQL and restore the databases to this version of mysql.
I hope this goes smoothly, it should.

Need help in retrieving MySQL data from a WAMP installation

Here's my situation: I decided to reinstall WAMP so I had to back up my databases, 50+ of them. Then I went on and did it. Then I started importing the databases back to phpMyAdmin, but got only 17 databases. Turns out phpMyAdmin never backed up any more. Now I have WAMP version 2.2 installed, with MySQL version 5.5.24, which is the only one in the WAMP menu. BUT, I do still have the old MySQL version 5.1.36 in my wamp/bin/mysql folder - with all the data files and so forth.
How can I either
get the data from 5.1.36 (I doubt just copy-pasting would work)
-- or --
get MySQL 5.1.36 back in my WAMP menu?
I downloaded MySQL 5.1.36 from WAMPServer homepage as an addon and installed it (backed up the original). This way I got 5.1.36 back in the WAMP menu and now I have my data back, yay!

Attaching an existing database with MySQL

Disclaimer: I have never used MySQL before!
I have a folder containing a number of .frm, .myd and .myi files that I believe are a MySQL database. I have pulled these files from a defunct server for a client who has not used the server or database for some years but is now looking to resurect some of the data for a new venture.
I have downloaded the latest free edition of MySQL, along with MySQL Workbench and am looking to connecct the existing database to the new installation; the equivalent to an "Attach" if I were using MS SQL Server.
I have found a few articles that say if I simply copy the folder into the data folder for MySQL and restart the service the database will show up. I have tried this (using both the data folder within the installation folder and also the "MySQL Datafiles" folder created during the intial configuration but when I restart the service nothing shows up.
How should I go about attaching this database?
Ok. I found the answer, the folder I was adding the database to was the wrong one.
Though I had found 2 "data" folders, there was a 3rd hiding in C:\ApplicationData; once I added my data files in here and restarted the MySQL service I could see the data.
On Windows 8 the default folder where MySql databases are stored is:
C:\ProgramData\MySQL\MySQL Server 5.6\data
5.6 is the version.
Please note it is ProgramData not Program Files which is easy to overlook.
Copying there and restarting the service worked fine for me. I'm even copying the DBs from an earlier 5.X version.