Trouble installing MySQL on Osx Mountain Lion - mysql

I'm trying to brew install MySQL on Osx 10.8.3.
I've found some posts recommending using the dmg, but I need to use the mysql2 gem, and I've read that it is better to use brew.
I've tried everything from the top two answers here:
brew install mysql on mac os
and tried this tutorial, but I still get this error:
Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/Thomass-MacBook-Pro-5.local.pid).
MySQL still runs (I don't really understand why), but trying to create a database gives this error:
ERROR 1006 (HY000): Can't create database 'asdf' (errno: 2)
I'm very much at a loss about what's going on, can anyone tell me what the issues here might be?

It appears that your database is either locked, or not started properly. I would suggest checking the PID at (/usr/local/var/mysql/Thomass-MacBook-Pro-5.local.pid) and either kill the process through terminal or from the PID File itself. As long as the PID is still there (whether it's asleep/zombied) you wouldn't be able to update/create a database.
You may also want to try rebooting your comp if you haven't done this step already.

Related

Having problems starting mysql on mac with mysql.sock.lock

I've already searched on this, and tried quite a few things. First, I'm on MacOS, 10.12.3, this is a new install of mysql, 5.7 (they work together, I checked). From the mysql.local.err log:
Could not create unix socket lock file /var/lib/mysql/mysql.sock.lock.
Unable to setup unix socket lock file.
Aborting
I've looked through other questions about this (and there are a LOT of them) and tried a lot of things. However, most everyone then says to do something like this:
service mysql start
At which point I get:
service command not found
So that's one thing that I've tried and failed and gotten stuck at.
I spent all yesterday working at this and following different rabbit holes trying to figure this out. I'm new at installing a database, so I'm asking for help. If I've done something stupid - just tell me - I just want to try and get my laptop up and running so I can continue learning coding.
Thank you all kindly.
If you install MySQL with Homebrew (brew install mysql), it is as easy as:
$ mysql.server start

Mysql on Ubuntu repeatedly changes my empty root password so I can't access the server

I'm getting pretty desperate because of mysql...
Two months ago I started working on Ubuntu and we have a project at university, where we have to maintain a webapplication written in Java with the Spring Framework. For this I needed to set up a local mysql server and for the application to work, the root password had to be empty...
However the problems started right away. Although I left the password empty on installation, the app threw an error because it couldn't connect to the mysql server. After trying all commandline password change methods on the internet I finally got it to work somehow.
But after a couple of day the same error occured again!! It seems like somehow mysql has changed the password on its own, maybe because it doesn't like it to be empty. The second time I had a pretty hard time resetting it, because nothing would work. For example if I tried to run:
sudo dpkg-reconfigure mysql-server-5.7
I simply got:
This installation of MySQL is already upgraded to 5.7.16, use --force if you still need to run mysql_upgrade
Using --force didn't help either. So in the end I settled for completely removing mysql and installing it again. This time I would provide a valid password and then install the mysql workbench and change the password in the workbench to empty.
This worked for about three weeks, but now I can't access the server again!!! I don't want to reinstall mysql twice a month!
I don't think the problem is with the application, because on my windows laptop I don't have any problems.
On Ubuntu im using Mysql-Server-5.7.
I hope someone can help me I'm really desperate...

homebrew: MySQL not starting, Can't update PID file

I am a new Mac user and trying to set up the development environment with Apache, PHP and MySQL. Initially, after a lot of installs and reinstalls i succeeded in installing MySQL (Apache and PHP came bundled with Mac) but now again mysql refuses to start up and gives the error, The server quit without updating PID file (/usr/local/var/mysql/Nikhils-MacBook-Pro.local.pid).
I have literally gone through entire SO questions regarding this problem but have not found a way to fix this and i mean i have done everything to start this but in vain. I have created the PID file too but it disappears in moments, i did a cleanup and reinstall using this SO Question but it has failed YET again. Please, i need to get my server started, i am really losing on to serious work and time.
Is there any other miraculous way to fix this unattainable feat? Also, if anyone asks what is the error in the log files, please don't as there is no log being registered as the server hasn't started yet.
I’ve got a similar problem with MySQL on a Mac (Mac Os X Could not startup MySQL Server. Reason: 255 and “ERROR! The server quit without updating PID file”) and after a long trial and error process, finally in order to restore the file permissions, I’ve just do that:
launch the Disk Utilities.app
choose my drive on the left panel
click on the “Repair disk permissions” button
This did the trick for me. Hoping this can help someone else.
brew install mysql on mac os
These instructions helped me. There was a my.cnf in /usr/local/opt/mysql/ which seems to have been the problem for me. YMMV.

Should I reinstall Mysql?

I'm getting kind of desperate here trying to get mysql to work on osx lion.
I've been through nearly every article on the web these past few days looking for a way to fix the problem with the error.
When I try to start the server is gives this error:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
when I try to create a database with 'rake db:create' it gives the same error.
sometimes it says that or I get errors about "please install gem-blabhalbhabhlb". And that gem doesn't exist.
I was able to install mysql in terminal using the dmg version from mysql's site but after I deleted the installation files it just stopped working- as in when I run
rake cd:create
I get the mysql.sock error.
I'm going insane.. please help
For me I often need to force mysql to not use unix sockets, but regular php sockets.
To do this, connect to 127.0.0.1 instead of localhost. Works 90% of the time, all the time.
Major credit to John P. for helping me get this working last night
The first thing was to uninstall mysql using 'brew uninstall mysql'.
Then to install mysql from their development site. The community .dmg 64 bits version.
Then to find out where the path was pointing.
So in updating the paths he had to find where bin/mysql was and make sure bash_profile had it's path there.
PATH=$PATH:/usr/local/mysql/bin
The essential step after that was to 'source' the file so he had me run this command.
source ~/.bash_profile
From there mysql works flawlessly.

trouble installing mysql

Trying to follow this tutorial, but my installation of mysql is failing.
After getting to the last line(launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist), I get the following error:
launchctl:
CFURLWriteDataAndPropertiesToResource
(/var/db/launchd.db/com.apple.launchd.peruser.501/overrides.plist) failed: -10
It is worth noting that I originally had an error for the second to last line:
cp /usr/local/Cellar/mysql/5.5.15/com.mysql.mysqld.plist ~/Library/LaunchAgents/
but I noticed I did not have a /5.5.15/ folder, instead I had a /5.5.14/, which I used instead.
Also, I am only following the mySql part of the tutorial, the rest I had already done.
Incase it is relevant, I have used MAMP on this machine, but have shut it down and restarted to no avail.
That error seems to indicate a permissions problem. Your homebrew installation might be a bit messed up. I'd try uninstalling mysql via homebrew via "brew uninstall mysql" and then removing homebrew entirely and reinstalling. You could also try running this script to fix the permissions. If that doesn't work, I'd uninstall and reinstall.