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.
Related
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.
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.
I have a created a database called "global" in MySQL 5.6.11.
The data files are stored in a separate folder from MySQL installation directory. Hence the database "global" can be clearly located in folder "global" in Windows Explorer.
What I did was, copy that entire folder to another directory for backup purposes.
Due to a bug in mysqldump.exe (5.5.16) which state that it has older version that the MySQL server (5.6.11), so I decided uninstall everything and remove every data (not the backup).
Then I install MySQL 5.6.14. And I copied back the "global" folder from backup to the root data directory of the new MySQL installation. When I open MySQL Workbench, it can detect the database. I even expand the "tables" node and able to see the list of tables in it.
Surprisingly, when I tried to query the data, MySQL showed an error those tables do not exist. Every single table does not exist everytime I query it by using simple syntax: select * from account. I even used the command line, but it still doesn't work.
Does someone know why?
I had a catastrophic drive failure on my development machine. Fortunately I have a backup of everything.
I just installed WAMP for the first time, and it seems to be working in windows 7 x64 (after the fresh install on a new drive). Now I need to get access to the databases I had stored on the backup drive..I don't have .sql dump files.
Does anyone know how I can get a database export from the MySQL folder I have on my backup drive?
Thanks!
A simple copy of files and folders located in MySQL data directory should do the trick (as long as MySQL versions are the same).
Not sure wheteher this will work . Just replace the your mysql folder in wamp installation directory with yours. Remember to keep back up before replacing
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.