Why can't I start mysql from the preferences pane on a Mac OSX when I change the datadir

When I click on the configuration tab of the MySQL preferences pane and change the Data Directory location to an external drive then I cannot start mysql from the preferences pane. The light goes green for a second and then suddenly goes red. It works fine when the Data Directory matches the directory given by the sql install.

what i see when I look at the preferences pane and try to start mysql

I presume that command line instructions that do the same things I described in the GUI are the ones given below which produce the same outcomes:

My-MacBook-Pro:bin jim$ sudo /usr/local/mysql/support-files/mysql.server start Password: Starting MySQL .Logging to '/usr/local/mysql/data/jim.local.err'. . SUCCESS! My-MacBook-Pro:bin jim$ sudo /usr/local/mysql/support- files/mysql.server stop Shutting down MySQL .. SUCCESS! My-MacBook-Pro:bin jim$ sudo /usr/local/mysql/support-files/mysql.server start --datadir "/Volumes/BackupPlus/mysql/data" Starting MySQL .sed: 1: "s/^/Volumes/BackupPlus/ ...": bad flag in substitute command: 'B' ERROR! The server quit without updating PID file (/usr/local/mysql/data/Daniels-MacBook-Pro.local.pid). 

1 Answer

I solved this problem by placing a copy of the current mysql directory in the location on the external disk where I wanted it to be. Before I had just created an empty directory in the new location I wanted the datadir to point to. I think it wasn't working because there are essential files in the data directory that make mysql work when you start it that need to be there at the new target location.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like