How to Restoring MySQL database from physical files - mysql

Unfortunately I uninstalled Xampp in my windows machine, there are about 50 databases in /xamp/mysql/data folder. I have not taken backup script, but I have a copy of Xamp/mysql/data folder.How can I restore MySQL Databases using that Data Directory.
Thanks in Advance

I was find out solution
Install new xampp
Copy your old database folder from
xampp\mysql\data\databasefolder to Paste in your running xampp folder
C:\xampp\mysql\data
After that stop mysql and apache service then backup your running xampp files ib_logfile0,ib_logfile1 and ibdata1 and store in safe place
Then Copy same file (ib_logfile0,ib_logfile1 and ibdata1) from old
xampp\mysql\data\ and paste in your running xampp server C:\xampp\mysql\data\
Start mysql and apache service Open CMD Fire command
C:\xampp\mysql\bin>mysqldump -u dbusername -p dbpassword dbname>D:\exportdb.sql
stop mysql and apache service and restore your main ib_logfile0,ib_logfile1 and ibdata1 file (check Step 3)
after than again start service and open http://localhost/phpmyadmin/ and import database backup from D:\exportdb.sql
Now your backup is working :)

Install the same Server version again, Stop it , copy the datadir and Start the servrr

I experienced with my Mac, before selling to a friend simply copy the XAMPP folder only to my hard drive.
(NOT SUCCESS) Unfortunately, it was bringing trouble to me, because I tried the following steps:
- I install fresh XAMPP and copy the whole \httdocs and var\mysql to my new Mac, those db only with .frm and .ibd, NOT WORKING, I can't still access the tables inside PHPMyAdmin ...
- I tried to install the same xampp version and repeat the above steps, still NOT WORKING.
- Decided to go to bed.
(SUCCESS)
- This morning, I brought my backup disk and try with Windows 7.
- Install fresh latest XAMPP for Windows, c:\xampp
- I have one of website (folder) from my backup \httdocs and correspond database folder inside \var\mysql are READY in my windows 7, I just want to try with one website then try the rest because I have many projects inside httdocs\ and \var\mysql
- I copy the mention httdocs\ folder to windows c:\xampp\httdocs and copy the \var\mysql to c:\xampp\mysql\data
NOT LAST YET
I copy the ib_logfile0, ib_logfile1, ibdata1 from my backup file to windows xampp c:\xampp\mysql\data
I refresh the http://localhost/mywebsite
WOW WOW DONE ... it's working...

In my case I found pretty straight solution.
I had db files in wamp and ported to laragon
Stopped laragon instance, no apache/mysql was running.
I have simply copied db folder[dbname] "example /mysql/data/dbname" from wamp to laragon "/mysql/data/" folder
Than I started my laragon instance both apache/mysql.
I have checked in phpmyadmin, I can see same database was recovered and now part of current mysql database.

Related

How to take backup of Mysql databases in XAMPP without using phpmyadmin

Here is my problem:
Because of some issues mysql not working in XAMPP 3.2.2 in windows 7. Then phpmyadmin in localhost shows Access Denied. So I want to reinstall the XAMPP. But, I'm unable to take backup of databases through phpmyadmin. Now how can I get the backup of databases. If I have the backup of data folder in xampp -> mysql then I'll copy the folder in new xampp folder then I'll get all my old databases with content or not. Is there any other way to get the backup of database?
Please help me to resolve my problem.
Short Answer: Yes, you will be able to recover.
Copy content from your /installation_path/xampp/mysql directory to your desired location.
ReInstall and copy back the content.
Restart your services.
[or]
If you have your backup in a Folder, do the following:
datadir = "your/path/mysql/backupdata"
in xampp/mysql/bin/my.ini

Copy a database from old WAMP installation folder to another

I just install a fresh copy of WAMP, and I want to import couple of databases from the old one to the new one, so I entered to the old mysql data directory C:\wamp-old\bin\mysql\mysql5.7.14\data, and copy the relevant databases there to the new data directory. But when I try to access the tables in phpmyadmin, I get a message saying that the tables aren't exists, but they do:
What am I missing?
You forgot to copy the ibdata file.
I did it successfully just now:
make a copy of wamp folder (wamp-old)
uninstall the wamp
install the new wamp (overwrite all the files if u were asked)
start the wamp
ck the localhost and phpmyadmin
copy your databases from the old-wamp only from C:\wamp-old\bin\mysql\mysql5.7.14\data and paste to the same location in new wamp
then copy and paste ibdata file from the above path and replace in new one.
You are done!
you can not restore databases like this way,
Please follow this steps to restore the databases from old to one,
Backup all the databases using phpmyadmin (Export Feature)
Install the fresh XAMPP
Restore the all the databases using phpmyadmin (Import Feature)
In my case the mySQL version of my old Wamp installation (5.7.26) was very different from the one in my new Wamp installation (8.0.21), so nothing from the solutions here worked for me.
I downloaded the old version of mysql from https://wampserver.aviatechno.net/#mysql_versions , installed it and replaced the hole ‘data’ folder with my old one.
Now from Wamp\MySQL\Version menu I can choose the old version and all my old databases are working fine.
You can leave that working version of mySQL or export the databases and import them to the new mySQL version.
Stop the Service (because it will complain for a file opened by another app) then Just copy and paste the ENTIRE (...\data) file from old installation folder backup to the new installation by overwirting the existing new installation file.
Finally, start the service.

copy mysql db from previous xampp to new one

I reinstalled my computer, before I did that, I copy my Xampp folder for backup.
the problem is i forget to backup my database from Phpmyadmin.
I tried to copy /xampp/mysql/data/ to new one but i got error
#1932 - Table 'phpmyadmin.pma__tracking' doesn't exist in engine
anyone how to fix this?
*browser is ok to access those data, but i have trouble to open it inside of phpmyadmin
If you are using windows, run a linux live cd and copy the xampp folder into your external drive then go to the target computer, run again live cd on the target computer or just boot it in safe mode(for windows) then copy the xampp folder into your target computers drive.

XAMPP MySQL Database Copy

I had to format my Mac as updating OSX Crashed. I had the backup of the XAMPP folder on my disk. Is there a way I can copy some files to the newly installed XAMPP folder and get all databases back?
Do I make any sense?
I tried copying all folder but XAMPP failed to start throwing Requires Admin Privileges
Note: I have no recent .sql backup of the databases.
I once had the same problem. It's not that complicated.
Just copy the folders of database to XAMPP/var/mysql/
That's all.

Cannot find old MySQL databases after upgrading MAMP

I installed Yosemite
Renamed MAMP to MAMP_old
Did a clean install of MAMP
Copied the db folder from old into the the new one
Now none of my databases appear in PHPMyAdmin
Inside the db/mysql folder I see the folder for my old databases, but there are no sql files. For example a Wordpress folder contains .frm files and db.opt files.
I tried doing this (using the link below), but I don't seem to have a mysql folder usr/local/
/usr/local/mysql/bin/mysqldump -u root -p[pass] [db] > [filename].sql
Can't access MySQL databases after upgrade to Mountain Lion (using MAMP)
What should I do to restore my old databases? I have very limited knowledge in this area.
Many thanks
I ran into this problem with upgrading to MAMP PRO 5 from 4. The following article proved invaluable:
https://appsolute.zendesk.com/hc/en-us/articles/215198946-I-upgraded-to-MAMP-PRO-5-and-I-am-missing-databases-
To quote:
Your old MySQL 5.6 data is in
/Library/application support/appsolute/MAMP PRO/db/mysql56_2018_xxxx
To be on the safe side, first make backups of your host data, and your
entire /Library/application support/appsolute/MAMP PRO/db/
To verify this is your old data, look inside of this mysql56_2018_xxx
folder, you should see subdirectories of all of your old databases in
this folder.
If you see missing databases in MAMP PRO 5, you can "reupgrade" your
old data by doing the following.
Quit MAMP PRO
Rename your mysql57 folder to mysql57_back
Make a copy of your mysql56_2018_xxxx folder, name it mysql57.
Start MAMP PRO, start your servers
Run Tools > Upgrade MySQL DB
Notes:
Instructions available online for MAMP (not MAMP PRO) may be misleading.
The above refers not to the /Library inside the package contents of the MAMP PRO app, but /Library from the root of your drive.
In my case the complete original databases were in the folder simply named mysql56. There were additional incomplete date-stamped folders suggestive of failures during the original DB update process.
Here is a link to an article which I think can help anyone in a similar situation:
How to Upgrade MAMP
So the basic idea is that you will need to copy your db files from the old MAMP folder to the new MAMP folder.
Another technique you could use would be do a mysqldump before upgrading, then import that dump file into the new version of MAMP.