Move native phpmyadmin databases to xampp - mysql

After a computer crash (Mac OSX Update), I was able to recover my files from a back up. In order to make things easier on me in the future, I decided to move to XAMPP instead of using the native PHPMyAdmin and MySQL. I know where PHPMyAdmin was pointing before - how do I move the files so XAMPP can see them?

It's not a recommended means of backing up and restoring, but as long as there's nothing in the XAMPP databases you might just be able to replace the XAMPP data directory with the backup from your old MySQL one. Note that XAMPP may have "important stuff" in the database by default; I don't use it so I have no idea. You can also just drop in specific databases (which are represented on disk by files or folders of similar name), but will have to recreate permissions and users for those.
It's better to do SQL exports and imports for backing up your data.

Related

Export table from Xampp MySQL from file directory

I have an error with Xampp where it will not connect to my database. I have had this error several times in the past and no solutions have helped. I find that uninstalling and reinstalling ends up being the fastest method, however, by doing so I lose my database tables. As I have no access to the default export and import functions, I was wondering how I transfer the tables across.
Last time, I copied and pasted these files into the same directory when I reinstalled Xampp and the tables transferred but the data within did not. The tables had also lost some functionality as well.
If anyone has any methods to do this I will greatly appreciate it.
The best way to backup and restore your data is to dump the database to an SQL file. You can use the provided mysqldump tool for that, which is the best tool for the job.
Copying the entire MySQL "datadir" (which is probably one level up from the screenshot you've posted) and completely replacing one of your new stopped MySQL instance will probably work, but is not reliable and is not supported. Since there are other files (such as ibdata1) that handle the overall health and functioning of the entire MySQL instance, you can't only copy over individual database directories. Furthermore, you should only do this when the original and replacement MySQL servers/daemons/services are completely stopped because otherwise there are file corruption or concurrency issues.
Since you're running the server on your own computer, you should grant yourself sufficient access to be able to use mysqldump and use that regularly as a backup, since file-level backups of the data directory are not reliable.

MySQL 8.0 Deployment with Data Seperate

I have been running MySQL 5.X for several years. Just come to a new server and downloaded V8.0.11.0. I installed it and it asked me no questions about where to keep the data, it has put it all on the C: drive. I want to keep it separate to make backup easier. How do I make the data location move to another disk?
What I have tried:
The old 5.7 method of stopping the server, moving the files, updating
my.ini and restarting. You can't move the files (Access denied) and
the server doesn't start if you change the my.ini file.
mysqld --initialise --datadir="F:\MySQL\Data" (tried forward slashes and double slashes as well)
I can't find any documentation! It's a pretty basic requirement so I'm guessing it must be documented!
OK, I uninstalled MySQL and then ran the installer again. The first question is where do you want to put things! I take it all back, apologies for missing it!

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.

Exporting a non functional XAMPP database?

I've been using XAMPP for several local projects.
A few days ago I installed Desktop Server for Wordpress local development.
Little did I realize, I wouldn't be able to open the regular xampp back up...
Now I need to export the databases I've created on xampp without being able to access the old phpmyadmin.
How can I do that?
Thanks!
It sounds like you have two MySQL instances on your machine. If one is using the MySQL networking port (3306), the other won't be able to start, which is consistent with what you're describing.
If you stop the one (from Desktop Server) then manually start the other one (in XAMPP, which you should be able to do from the XAMPP control panel), you can then connect to it and export your database.
You can't safely merge the two database data directories, but in theory if you completely stop both MySQL instances — and back everything up — you should be able to completely replace one datadir with the other. I don't generally advise this, because the possibility also exists to lose your data.

MySql move databases, new installation OSX Mavericks

Recently I made a clean install of OS X Mavericks, and right now i have setup ok mysql,phpmyadmin and apacheserver is running without problems.
PhpMyadmin as i was sure it will be, has no databases.
The databases are located in another disk installation from MountainLion that i was running before.
I understand that i can login PhpMyAdmin and export those databases in .sql one by one but there are a LOT,so i was wondering if there is a faster method to access the files and move to the Mavericks disk.
I remember in another installation i was digging around and i found those databases in the disk but my problem was that they were directories and not just .sql files to copy/paste, and i think that i had permissions problems
By that time they were not many so i prefered to use standard method, export from phpMyAdmin and then import again in the other OSX installation.
I have root access for sql.
Basically everything is the same/carbon as the old installation of MountainLion (username,password etc) so i was wondering if i can copy/paste somehow method.
If permissions needs to be set correctly please advise.
Try out MySQL Workbench for exporting and importing databases:
Workbench
Features
You can connect to one database and fetch data directly from another.
Allthough DannyThunder answer can help a lot other users (and i will choose it as correct) i will go with what most of the devs suggest, to use mysqldump. Problem was that i thought i will not have access to old sql that is why i had to copy/paste somehow the folders, i have backup allready and i am in mavericks and currently restoring.
Backup (from another OS,server etc): mysqldump -u username -p -–all-databases > file.sql
Restore (to the new OS,server) : mysql -u username -p < file.sql
The others have given several good alternatives (I tend to use mysqldump as well), but I'll just point out that phpMyAdmin has no problem exporting multiple databases. Not sure why you think you have to do them one-by-one, but from the main page click Export; by default all databases are selected, you can use the "Custom - display all possible options" radio button to select certain databases only.