Restore SQL database for WordPress - mysql

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

Related

mysql workbench dropped table

my MySQL workbench setup with a database on it. I was using xampp with it but xampp stopped working so I uninstalled and reinstalled it. could this be the issue as to why the table went missing?
workbench is only a Gui, it will not drop anything without any user input.
MySQL server and xammp would work parallel when you choose a different port for one of them.
Your problem is that both save theier files in diffrent path(default)
MYSQL saves its data in
C:\ProgramData\MySQL\MySQL Server 8.0\Data
While xammp stores their database in
C:/xampp/mysql/data
in Restoring MySQL database from physical files you find a tutprial how to restore your tables from the files from your old installation

Exporting a table without using phpMyAdmin in MAMP

I have been working on a web application using ExtJS with a SQL Database hosted on phpMyAdmin using MAMP. About 2 weeks ago, I had to dump my old HD because of bad sectors and I got an SSD as a replacement. After installing my applications again (IDE's, Document Editing Softwares, MAMP, etc), I had to reinitialize my databases in phpMyAdmin.
Luckily, I had one of them online in production so I just exported the SQL from the server and I had a local copy again. However, there's this one other website that I do not have a backup to the SQL file of -- and I need to get that SQL file because I can't create it from memory (I think it had 30+ tables already).
I know I can plug in my old hard drive, boot from there, open MAMP, open phpMyAdmin, then export my database. However, that's too much work and I am not sure if that's a good idea.
Is there a way to extract the SQL file of a phpMyAdmin table by using the file directory/structure alone? I think MAMP is supposed to store the data somewhere so that phpMyAdmin knows where to get its SQL tables.
Update
I found my "database" under /Applications/MAMP/db/mysql/ProjectName/ but they're .frm and I'm clueless on how to open this.
Take a look at this answer: Restore the mysql database from .frm files
You'll need a couple more files other than the .frm, but you can solve it with the files alone, no need to plug in your old drive again.

How can I recover sql tables from a broken Xampp

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.

Re installing Wamp Server without replacing the existing mysql database

I have some problem with WAMP server installed on my computer, every time I am trying to access a server file in the browser the page keeps on loading for hours and does not give me any errors.
So what I though is to go ahead and install and new one but my existing MySQL database has lot of data inside it that I do not want to loose, I tried to backup the database using command line but no help there as well.
Is there any way I can install a new WAMP server while keeping my existing MySQL database?
The wamp server stores all of mysql database table in .frm formate inside WAMP_DIR_LOCATION\bin\mysql\mysql5.5.16\data you need to rename this "data" folder to "data-old"
And when you have reinstall the wamp server just rename the "data-old" folder to "data" In this way you will not lose your database.
In the "WAMP_LOCATION/mysql/data" folder are the tables for MySQL. You can copy the folder and make a backup.
But you should look that you install the same version again. Sometimes MySQL has a problem with different versions.

How to recover Mysql database from backup files

I have using VPS that had to be re-imaged. my DB was part of it and it was being backup up as the app wasn't in production yet. However, there is some data that I wish to recover on it. the VPS provider is giving me a backup of the image (Ubunto Linux) that has all the files.
Is there a way I can recover my data?
The mysql data files in Ubuntu are located at /var/lib/mysql
To restore your database you need:
1) create new database named as old one
2) stop mysql server
3) copy old database files from /var/lib/mysql/your_database_name/ to new system
4) start mysql server
Your database will be restored.