I installed LaMp 2 days ago. First everything works;
But until yesterday, I can't start anymore mysql server : it failed each time.
When I look at the status :
systemctl status mysql
Failed to get D-Bus connection: Erreur inconnue -1
It's like it can't generate mysqld.sock
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
I keep reading man and trying to find something I didn't configure correctly, but I can't find nothing.
Please, help me to resolve that problem.
Try to use this command in a terminal:
sudo service dbus restart
or this:
sudo /etc/init.d/dbus restart
Probably this is a temporary solution, this means that you'll have to do that command everytime you got the dbus error.
Related
After resizing the server at DigitalOcean, MySQL no longer works. I restarted MySQL. Upgraded MySQL. Restarted WHM. Nothing works. I think it has to do with mysql.sock. But I tried every solution on stackoverflow. Still doesn't work. Would you mind taking a look?
[root#ns ~]# mysqladmin -u root -p status
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
Screenshot Terminal error
Screenshot phpMySQL error
In order to trace the issue, we would need some more information, please post the output from your MySQL log .
I install on my MacOS Sierra long time ago MySQL using brew install mysql and everytime I turn off and on my computer mysql started automagicaly what was great. But unfortunately yesterday I needed to temporarily shutdown MySQL - so I found on internet some command (but it was not brew services stop mysql) and after that when I reboot my computer MySQL not started (I was unable to connect by Sequel Pro GUI MySQL client). So I try to run it by:
brew services start mysql
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)
But I was still unable to connect :(
I try to connect by following command (to change root password) and get hint:
Mac-mini-Kamil:local Kamil$ mysqladmin -u root password 'xxxx'
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
I type this 'hint' to internet and find out that I need run the following command:
mysqld
And that works :) (I was able to connect to my db)
I am a bit new Mac. I tried installing mysql5 using the following link:
http://matthewcarriere.com/2008/04/02/installing-mysql-on-mac-os-x-leopard-using-macports/
When I tried running the following:
sudo /opt/local/bin/mysqld_safe5 &
I got this:
[2] 59079
ps: No user named 'axww'
130911 13:35:11 mysqld_safe Starting mysqld daemon with databases from /opt/local/var/db/mysql5
After this, I tried the following:
mysqladmin5 -u root -p ping
I got the following error:
mysqladmin5: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/opt/local/var/run/mysql5/mysqld.sock' exists!
How do I fix this?
That article is obviously a bit antiquated. The modern preferred way to start a daemon installed with MacPorts is by using the port load command.
sudo port load mysql5-server
Stop it by using port unload.
When I run the app, I will get this error message:
/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (Mysql2::Error)
If I try to run
mysqladmin variables | grep socket
The result is:
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
I am pretty sure I was working with Rails 3.2 and MySQL, but now it doesn't. I am running on Mac OS Lion, could you help me please what am I missing?
Thank you
Type ps aux | grep mysqld in the terminal and see if anything shows up besides the grep command. If not, you're mysql server isn't running. Otherwise try typing mysqld start in the terminal and see if you can't get your sql server to boot up.
Edit: Sorry, on OSX the command to start it should be mysql.server start
I run the mysql command at the command line but I get this error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I've Googled a lot but I'm unable to resolve the issue.
Please HELP!
It sounds like mysql isn't running. This will tell you if it is or not:
sudo netstat -tap | grep mysql
That's because the path you specified doesnt have the socket required to connnect to the mysql. This problem has happened with me. Either you can reinstall mysql or search for the mysqld.sock and then move it to the specified directory.
Try running this command to start the mysql server
/etc/init.d/mysql start
/etc/init.d/mysql restart