How to properly restore data from an old XAMPP data backup - mysql

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.

Related

Databases are found in phpmyadmin but contains no tables

My old 2003 server became unstable, so I copied the database folder to an external disk in an zip file just before it died and burnt the hard-disc to in the process.
So I am stuck with at hardcopy of my server folder it was setup around ten years ago so it was made in an old version of MySQL and administrated with a just as old version of phpmyadmin.
But no matter which version of phpmyadmin I try I end op with same error it cant find the tables or more correct open them and when I click on a table i get a #1146 error.
Is there anyway around that problem
I am now running on a 2016 server with the latest mysql, php and phpmyadmin and i tried for three months to find a solution, but with no luck sp far.
Is the databases to old to run with the newer versions?

How to get MYSQL database from Xamp

I used xampp sometime ago to run mysql server. I forgot to save a copy of my database. Now my hard drive has crashed and I can only use it as external drive. Using it as an external hard drive I can access the xampp installation folder but I can't seem to find copies of mysql databases.
So this is what i tried:
But I found my database names in C:\xampp\mysql\data\voting
directory, where voting is a my database name. Now, in the voting
folder, I can find all my table names but they end in some wierd
extension (.frm or .ibd) that I cannot import to a new xampp that
I have installed. For instance there is a table in the voting
database called candidate .
My problems is that is there a way I can retrieve my database from the xampp installation folder?
If NOT, How can I get mysql database using xampp(Without sql,csv or json files)
NOTICE: The xampp directory is an old one and I cannot run it because it is on a hard drive that is slightly crashed and can be access externally to a computer.
After posting this for 3 days and getting no answer, i toiled and toiled until I got an answer.
What I did was I copied the data folder in C:\xampp\mysql directory where I installed xampp from my old xampp installation folder on my old hard drive.
I pasted the old data folder I copied into C:\xampp\mysql directory of my new hard drive.
NOTICE: there is an already existing data folder there, so I backed up before doing any changes.
Finally, I opened http://localhost/phpmyadmin/ in my browser and I can now see all my old MYSQL databases.

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

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.

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.

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.