Mac OS X mySQL custom database path (MAMP PRO) - mysql

I'm using MAMP (OS-X 10.6.6) and I want to move my mySQL db folder to my dropbox folder.
The MySQL server MAMP runs stores its databases in
/Library/Application Support/appsolute/MAMP PRO/db/mysql
..and I can't get it to follow symlinks or aliases to the mysql folder.
Is there a way to change the path mySQL uses for storing its databases? On the MAMP forum they say it's not possible, but I imagine there must be some kind of config file for whatever mySQL server it is that MAMP is running that can be changed to specify an alternative location for the used DBs..?
Anyone know how to acheive this? Storing the DB's on dropbox is the last element I need to solve to be able to work on my projects from my different computers.

Just realized that its just the finder 'alias' type that won't work. creating a proper unix symlink works fine. so doing this solves the problem and keeps the databases on dropbox.
ln -s /Users/username/Dropbox/MAMP_db/mysql /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql

mwb's method works. Remember, you also need to be be running Apache/MySQL server as user. Those settings are in MAMP PRO (Server -> General)
If you are going to be using dropbox to access the database on another machine, you will need to have identical paths to Dropbox as well.

Related

MAMP / MAMP Pro database conflicts

I sometimes get the databases in phpMyAdmin that are stored under /Library/Application Support/appsolute/db/mysql, this should be the path for MAMP PRO. However, I don't use MAMP PRO. I have tried the trial once, and continued using the free version.
However, sometimes I get the databases visible under /Applications/MAMP/db/mysql, they are a bit off, and I am missing a database there I was working on the other day, but the database is visible in the MAMP Pro database.
I have tried copying the database to the MAMP free database folder, but this results in giving errors in phpMyAdmin. It does show the tables in the database, but it cant display the structure of the tables.
Update:
Still experiencing this issue. Right now I just started my Mac and started MAMP, wanted to continue working on a project and it loads the other database (I think this is the database stored in MAMP Pro), when yesterday it was loading the MAMP databases.
I have no idea how and why this is happening, and how I can find the issue.
Long story short: MAMP uses the MAMP Pro databases sometimes in /Library/Application Support/appsolute/MAMP PRO/db/mysql instead of /Applications/MAMP/db/mysql/, note that I don't have MAMP Pro, I have the regular MAMP. Sometimes it uses the MAMP database folder, sometimes it uses the MAMP Pro databases folder.
MAMP is using this mysql database:
/Applications/MAMP/db/mysql
MAMP PRO is using this databse:
/Library/Application Support/appsolute/MAMP PRO/db/mysql
this may help I'm not too sure - your databases should be in either one
This sounds like a path related issue.
Check your system paths and fix any errors that are pointing to MAMP Pro.
Also, check your MAMP conf file and see how the datadir is set, is it set to the MAMP Pro location ?
SHOW GLOBAL VARIABLES LIKE 'datadir';
datadir - /Library/Application Support/appsolute/MAMP PRO/db/mysql/
An example of a custom conf file used to change this
default-storage-engine=MyISAM
innodb=OFF
datadir=/Users/someuser/drive/mysql/
Let me know in the comments if this helps and we can work out the error as we go along, I'll edit the answer accordingly if need be.

Use XAMPP-phpmyadmin database of windows in Linux XAMPP

I was on windows and using XAMPP(installed somewhere else than C:/ )
Now i have moved on to LINUX and installed LAMPP.
So, i have this XAMPP folder from windows and i copied the project files from htdocs and now i need the database which i didn't exported while i was on windows.
I tried to copy the phpmyadmin folder from the old XAMPP folder but couldn't get it to work.
So how can i access the previous OS phpmyadmin to use my existing databases -
using linux (MINT - rosa-cinnamon)
Thanks in Advance !
If you want to move databases between hosts - especially when there are differences in the MySQL daemon version, operating systems (-versions) or storage schema - you should create a MySQL dump at host A and import it on host B: http://dev.mysql.com/doc/refman/5.7/en/mysqldump-sql-format.html
If this is no option for you anymore, you can try to move the old MySQL data directory (Configured in my.ini on windows, somewhere in the xampp directory) to the location where the new MySQL daemon stores its data files (Normally configured at /etc/mysql.my.cnf). A few more hints on this:
Ensure to modify the file permissions on the data files at the new location that the MySQL daemon can work with them.
On Windows, MySQL table names are case insensitive. On Linux they are case sensitive. Keep that in mind, if your application complains about missing tables.
And of course: Test this with backups only!

Manually placing MySQL database files in the data folder - WAMP - XAMPP

I recently switched from using XAMPP to WAMP on my Windows 7 machine so I can do fast switching of PHP versions.
I completely uninstalled XAMPP, but first I backed up my htdocs, apache and mysql directories just in case.
After I installed WAMP and had everything up and running, I figured I could just drop some of my databases from my old XAMPP install into the "data" directory of the mysql directory in WAMP.
So that worked and the database shows up in phpMyadmin, but there are no tables. Is this a permissions thing? Like maybe I don't have the same user in the new install of mysql? Or am I missing something?
Am I allowed to just copy MySQL databases from one data folder to another or does it not work that way?
Both instances are using MySQL 5.5 (at least that's what both README files say in both MySQL directories).
THANKS
When using phpMyAdmin out of the box so to speak in WAMP, MYSQL is installed as per its default installation with the root userid setup to have NO PASSWORD.
Some people seem to think they should make one up when they see the login screen, is that what you are doing?
When you do this phpmyadmin allows you to APPEAR to login but then as you do not have root's privilages you see almost nothing on its other screens and are allowed to do nothing.
Use
username = root
password = (leave this blank)
Then set a password, there is a link on the next page it presents. AND DONT FORGET IT!!!!
This generally isn't a good idea. RiggsFolly was asking about your table type because some table types are more forgiving than others. Other possible trouble spots include file system permission problems or MySQL permission problems (as RiggsFolly asked).
I'd suggest to do an export (as an SQL file) and import that for a complete solution.

Created a mysql database but can't seem to find it anywhere

I just cloned a repo from github and bundle installed everything and created a mysql db via rake db:create. I migrated the database and everything....however, I have no idea where it is located? Usually when I use sqlite, it's in the db/ folder...but this database is not. where can I find it?
Look in your MySQL config file. Usually it's called my.cnf. Where to find this config on your system, we can't say :-)
Look for datadir in a config file
[mysqld]
datadir=/var/lib/mysql/
MySQL works a bit differently than sqlite. Whereas sqlite writes a database directly to a file (in your db/ directory in the case of rails), MySQL writes it to a server (usually located on the same machine as your application, but not always). I would be surprised if an app you cloned off of github let you create a mysql database right off the bat. You need to set up a mysql server and set a password for it. If you're running Ubuntu -- as I am -- these are some good instructions. Then you need to configure your config/database.yml file accordingly.

Upgrading MySQL on Mac OS X Server

I'm attempting (and failing) to upgrade MySQL on Mac OS X Server (Leopard) and running into trouble. Though the OS X Server docs say it's "normal" to have multiple versions of MySQL on your machine they don't go into any detail of how to "manage" them.
I have built and installed a newer version (5.1.40) than the original that Apple bundled (5.0.x).
Server Admin seems to manage only the initial (5.0.x) installation in /usr/bin
So I've STOPPED that version in Server Admin but can't get the new one (in /usr/local/mysql) to work.
Ideally I'd like to point the new version of mysql at the old database files in /var/mysql but not sure how...
Edit: Looks like my new MySQL is active (for some users anyway) but it's pointing to a different data file. It's pointing to /usr/local/mysql/data and I want it to point to /var/mysql
Admin user can connect but others get: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2). I'm assuming because this new database doesn't have those users enabled yet?!?! though I'd think I could still $ mysql -u root -p to it?!?
Anyone know how to manage this?
Well, I renamed the new MySQL's data directory to data.backup and then I created a symlink from where the new MySQL's data folder was to /var/mysql (where the old data file is) and so far so good... New version of MySQL is running and using the existing data file for its databases...
I'm not sure how to resolve your issue, but maybe you could trying using Homebrew or another OS X package manager to handle your software.
Will make upgrading in future a breeze.
EDIT: Sorry, just realized you are using OS X SERVER, I'm not familiar with it or if you should be using Homebrew on it.