How can I recover sql tables from a broken Xampp - mysql

I made a mistake in my latest upgrade to Xampp, I copied my old Xampp directory to C:/Xampp - Copy but I forgot to export out the mysql tables. I then uninstalled xampp and installed the new version.
I tried to access the phpmyadmin from the Xampp - Copy folder but I cannot get access to it to dump its tables, is there anyway I can gain access to my old tables?

c:/xampp-copy/mysql/data
See This directory for your database tables.
if these are in unreadable format then i think problem is with your Database engine. Checkout the following guidelines.
InnoDB Backup and Recovery
Moving or Copying InnoDB Tables to Another Machine
See This Answer also. Import .frm and .opt files to MySQL

I managed to get it working through the new PHP My Admin, all resolved now.

Related

Restore SQL database for WordPress

Unfortunately my VPS got corrupted and therefore I wasn't able to perform an export of the sql database with phpmyadmin. I do managed to copy all the SQL files .frm, .idb, .opt etc
Is it possible to recover the database and make my wordpress site working again?
Im using centos7 with Plesk Onyx / phpmyadmin
Absolutely! First get a new instance of your VPS running and create your database again, after created copy the .idb(innodb) or .myi/.myd(mysami) files right back where you found them
Each table comes with a .frm, don't forget those, as well as a db.opt for the database
Typical mysql storage (on linux) is located:
/var/lib/mysql/database_name
Once copied over restart mysql and check again

WAMP: using .MYD, .frm , .MYI , db.opt to restore database

Some days ago I forced to uninstall my wamp cause I didn't have any access to phpmyadmin, so that I just copy the MySQL folder of that damaged wamp before uninstalling to have databases to reuse them later
Now I installed a new version of wamp and when I pasted the databases file such as .MYD, .frm , .MYI , db.opt in the data folder of MySQL wamp, in phpmyadmin I can see the tables but when I wanted to see the columns I got this error:
#1146 - Table 'Databasename.table_name' doesn't exist
Please tell me whats wrongs with them? is there any way to use my old databases? If attaching database files is needed to tell me to do that...
luckily the problem solved by my self!
I did it in the simplest way! just deleted last MySQL folder which was the newer version of MySQL and pasted that previous MySQL folder in it, then just edit the my.ini file and correct the wrong address and folder names
Don't forget to restart the services
for my self, there was no need to do something with MySQL command line which some friends said to do
if you think deleting MySQL folder could be riskable install a new wamp which has got as the same version of previous damage databases...
So the version of both databases have to be the same, especially when your database engines are InnoDB
hope be helpful

How to restore MYSQL database after installing a different version of WAMP?

I would like to know How to restore MYSQL database after installing a different version of Wampserver. The explanation is as below:
I deleted the wampserver folder accidentally and I lost my MYSQL database. However, I have succeeded to restore the data folder that contains the database and I have installed another version of Wampserver (Actually, the old version of MYSQL that I was using was 5.5.8 , and the MYSQL version that I am using right now is 5.6.17) and I have tried to restore the database by copying its folder and putting it and the old ibdata1 file under the data folder of the new installation. But, unfortenately, that doesn't work.
So, my questions are:
Is it possible to restore MYSQL database after installing a different version of Wampserver (with a different version of MYSQL)?
If yes, how can I do that? What would be the solution?
In the past when this has happened to me, the only option that worked was to reinstall an older version of WAMP (i.e. MySQL) to match what my databases were created in originally.
If you install the same WAMP again, copying the folder should work now.
If you can gain access to your databases at this point, then you can do a proper backup of them using phpmyadmin or mysqldump etc.
After you get a proper backup, remove the older WAMP version and install the latest version again. Now you have to restore the databases using the backup files in order to put them into the newer MySQL version.
If you backed up your database you can restore it using your backup file. If you are using a graphical interface for mysql like PHPMyAdmin there is a import button you can use to import your .sql, .csv, .zip, or what ever extension you used to backup your database.

XAMPP NOT WORKING! - OS X Yosemite

I was working with XAMPP 1.8.3-3 on OS X Mavericks. After upgrading to Yosemite Mysql server stopped working. And an upgrade to XAMPP 1.8.3-5 fixed the problem and mysql server starts working.
Now the entire database list is showing on phpmyadmin, but no access to the tables. Its showing “#1146 - Table ‘DB_NAME.TABLE_NAME’ doesn’t exist”.
Unfortunately I don't have any DB backup!
I have the entire XAMPP folder backup. So how I can able to retrieve the mysql tables?
just type /Applications/XAMPP/xamppfiles/bin/mysql.server start
in terminal then start xampp
you can restore if you have all the mysql folders from XAMPP folder. (check /XAMPP/xamppfiles/var/mysql in backup)
if you have var/mysql folder, open and look for database names you had earlier.
there is a separate folder for each database you had earlier. open the folder and it will contain lots of files with table names.
if your old table engine is InnoDB you will see 2 files. with .frm and .ibd extensions.
or if you had MyISM it will contain three file per table which has .frm, .MYD and .MYI extensions.
after you verify you have all the required files in backup, you can start restoring them.
stop mysql
copy required database folder completely and paste it to currently installed folder. (/Applications/XAMPP/xamppfiles/var/mysql/)
start mysql
to restore web files, open htdocs folder in backup and copy required site folder to currentely xampp installed htdocs folder.
This solution worked for me. Good Luck !
Do a clean install. See my answer for my own question. xampp mysql server not starting. The bad part is that I'm not sure if it will save your database the way I explained. What you might try is going to xampp > xamppfiles > var > mysql > 'your database name' and making a copy of the database folder on your desktop and moving it back once you reinstall it. I tried and I think it might have worked had I changed the file permissions. You can also try experimenting to see if it preserves the database if you do this. I would do some serious testing if you really want to save your database before doing this.

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.