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

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

Related

First time using phpMyAdmin but getting multiple error messages about invalid connection and don't know where to start

screenshot
I am unable to connect to phpMyAdmin. This is my first time using it. These are all the errors I am getting, but I don't understand what any of them mean.
I installed XAMPP, ran Apache and MySQL, selected Admin, but then I get these errors in the screenshot attached.
I am completely new to this. I've been trying to follow a beginner guided project for MySQL on Udemy and the instructor is using phpMyAdmin. But, I couldn't find any instructions on how to install it and so I tried googling it and figuring it out myself. I looked at similar problems posted on here, but I honestly don't know where to start. Any suggestions? Or at least where to start?
I tried going into Config to check host, username, and password, but I am not sure what to look for and how to repair the problem.
I had MySQL Installer - Community and installed MySQL Workbench, MySQL Connector and MySQL Server prior to installing and using XAMPP. I was wondering if that was the problem so I uninstalled all of them, but I got the same errors anyways.

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.

connection refused mysql node.js

I've tried everything under the sun to fix this problem, nothing works!
I'm trying to connect to mysql using node.js.
I've tried both normal connections and pool connections, but I keep getting the following error:
"connect ECONNREFUSED"
I'm working on a Windows 7.
There are many similar questions to this on Stack Overflow, and everyone mentions the mysql configuration file (and commenting out "skip-networking"), however, I can't find where the file is (the mysql module was installed under node_modules).
I've tried looking for my.ini and my.cnf, there don't seem to be on my machine either.
Is there a way to try to log in to mysql via the command line?
It seems like there isn't since the command line doesn't recognize the command "mysql".
I'd post the code that I've been using but that wouldn't help, since I've been using dozens of different alterations, and all fail.
Thanks in advance, I appreciate the help!
Thanks to Салман, I realized that I need to install the actual MySQL server as well.

Trouble installing MySQL on Osx Mountain Lion

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.

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.