I have got installed MySQL by default in CentOS 7. It is allowed to start with Firewall and etc.
But I cannot start it using
sudo /sbin/service mysqld start
Error
...No search file or directory
All links about this subject dont help.
Any clue how to start it?
P.S. I found where is mysqld but when I start it I see many errors.
As I discovered MariaDB was not installed properly.
Once it is installed I could access via mysql.
Related
environment
OS X El Capitan 10.11 , Mysql 5.6.26
What I did
mysql port was 3307 when I installed it. ( I didn't install it using brew.)
I changed the port 3306 to 3306 by editing /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist after using mysql with 3307 port for 6 months well.
I revised <string>--port=3307</string> to 3306.
I tried to stop and It didn't work. So I used following:
sudo kill -9 [PID]
It's killed and didn't start. So I changed the port 3006 to 3007.
I tried to start mysql server with following command and got a error.
sudo /usr/local/mysql/support-files/mysql.server start
ERROR! The server quit without updating PID file (/var/lib/mysql/nhnui-MacBook-Pro.local.pid).
And I found some helpful advices in follwing link.
reference link :
After MySQL install via Brew, I get the error - The server quit without updating PID file
I tried to change ownership of files, checking my.cnf file, checking error log file and all didn't work for me.
Finally, I removed /usr/local/mysql/datamysqld.local.err , /usr/local/mysql/datamysqld.local.pid and rebooted mac.and I can start mysql server.
The Problem
Then, the problem is above tip is not perfect for me.
mysql server was running after restarting mac. I checked it with 'ps-ef | grep mysql'.
Stop and start was success and then it didn't stop it again cause of same error!
Screenshot of the error :
Of course, I did it again (I mean deleting .err , .pid file / rebooting mac / cheking mysql ps / stop - start (well) / stop (got error)) and checked that it has same error.
Here is the error log : /usr/local/mysql/data/mysqld.local.err
Now, mysql server can't stop.
What can I do to solve this?
P.S - If it will be better to reinstall mysql, I should do that.
Make a backup of your system.
Dump your data into text files.
Uninstall everything releated to mySql (a quick Google search will point you to several how-tos)
Reinstall mySql from the package in the .dmg available from mySql website.
You can choose the latest 5.6.x or 5.7.x
Set the mySql root password and you're done.
When things get messy and all you can do is guessing what's the fix it's faster to reinstall given that a package installer is provided for mySql (you don't have to compile it yourself or play with brew/macports).
I have just upgraded to Kubuntu 15.04 and MySQL is no longer working properly. The error is:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)
I have checked and there is no mysqld.sock file at that location (and no directory 'var/run/mysqld'). I've tried creating a directory at 'var/run/mysqld' and using chmod to make it writable by all, then restarting MySQL using 'sudo service mysql restart', but this doesn't solve the problem.
MySQL seems to be running (it's coming up as loaded & active when I run 'sudo service mysql status'). There's nothing in the MySQL error log.
I can't find any mysqld.sock file at all (did a search across the whole file system).
Any solutions before I give up and purge/reinstall mysql would be gratefully appreciated!
EDIT to add:
The MySQL process itself isn't in the process list. No errors are thrown when I start/restart MySQL using 'sudo service mysql', and /var/log/mysql/error.log is empty.
I managed to get it working by changing the permissions on /var/lib/mysql and then running "mysqld" at the command line
So presumably some sort of permissions screw-up that happened as part of the Kubuntu upgrade.
I recently upgraded my system to OS X Yosemite and started encountering some issues to connect locally to my Database via MySQL Workbench.
It was mainly classic ones about the PID files and socket, that I managed to find solutions for looking over the web. However one was remaining : "Can't connect to MySQL server on '127.0.0.1' (61) (2003)", and none of the solutions I found on the MySQL website, stackoverflow and other forums were working.
I therefore decided to reinstall MySQL using the dmg file (version for OS X 10.9 though, no version yet available for 10.10). It did not work.
That's why I eventually uninstalled every little piece of mysql that I could and reinstalled a clean version using homebrew. The steps I followed are those ones.
However, this did not work either and here is the error message I got :
$ brew postinstall mysql
==> /usr/local/Cellar/mysql/5.6.21/bin/mysql_install_db --verbose --user=Antoine
Installing MySQL system tables...Unknown suffix '.' used for variable 'server_id' (value '127.0.0.1')
2014-10-20 02:35:05 0 [ERROR] /usr/local/Cellar/mysql/5.6.21/bin/mysqld: Error while setting value '127.0.0.1' to 'server_id'
2014-10-20 02:35:05 0 [ERROR] Aborting
2014-10-20 02:35:05 0 [Note] Binlog end
It makes now a little more sense that MySQL server was not able to connect to 127.0.0.1, but I must say that I'm lost and do not really know where to look anymore. I can't find anything on this error message. I had a look to the mysqld file, but it was useless.
Do you think the issue is linked to OS X Yosemite? Any clue of what I could do from here?
I had the same problem, here the solution:
http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-10-yosemite/
You only have to start again MySql:
sudo /usr/local/mysql/support-files/mysql.server start
I eventually managed to fix the issue by, in this order :
1/ Upgrading to xcode command line tools 6.1
2/ Following those steps to remove completely MySQL
3/ Restarting my computer
4/ Installing MySQL back with the OS X 10.9 package (dmg file available on mysql website)
5/ Copying the my-default.cnf file to the etc folder : sudo cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
6/ Starting the server the first time with this command in terminal : sudo /usr/local/mysql/support-files/mysql.server start
No PID issue, no socket issue, no connection issue to localhost. Everything's fine now.
Right after upgrading to Mac OS Yosemite (10.10), my Mysql won't start anymore. Instead I get
MacBook-Pro:/ user$ sudo /usr/local/mysql/support-files/mysql.server start
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/mysql/data/wireless.ubc.ca.pid).
I tried to check version number but I also get the following error
MacBook-Pro:/ user$ /usr/local/mysql/bin/mysql -v
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I found lots of people having problems with XAMPP not working after Yosemite install, Also eclipse not working. I see many people just say reinstall. Is there anyway to fix this?
I haven't yet updated to Yosemite yet but I had this link saved when I do:
Get Apache, MySQL, PHP and phpMyAdmin working on OSX 10.10 Yosemite
This specific line may do some good:
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
But check the whole post and let me know if it helps!
Good luck!
I don't think so this installation is needed. I got the same issue when I upgraded to Yosemite.
I tried to run the mysql server through command line but it failed, saying
Starting MySQL
.... ERROR! The server quit without updating PID file (/usr/local/var/mysql/Bilals-MacBook-Pro.local.pid).
I went in preferences and clicked mysql there, and it was stopped. Start mysql from preferences which will ask for root password, and it worked :)
After updating MySQL I also for some reason have to change the permissions of the MySQL dir for it to work. The installer always changes the permissions to root.
chown -R _mysql:wheel /usr/local/mysql-5.6.21-osx10.8-x86_64/
None of these answers worked for me. I reinstalled mysql using homebrew and it worked.
http://blog.joefallon.net/2013/10/install-mysql-on-mac-osx-using-homebrew/
I am not able to start MySQL server on Mac OS X 10.4.11. MySQL was installed using Macports. MySQL was running fine until it suddenly died without any obvious reason.
When running "mysql", I get the error message:
ERROR 2002 (HY000): Can't connect to local MySQL server through
socket '/opt/local/var/run/mysql5/mysqld.sock' (2)
If I try to start MySQL manually, I get the following error message:
sudo /opt/local/share/mysql5/mysql/mysql.server start
Starting MySQL/opt/local/share/mysql5/mysql/mysql.server: line
159: kill: (636) - No such process
ERROR!
In /etc/mysql/my.cnf I have:
socket = __PREFIX/var/run/mysqld/mysqld.sock
But the path "opt/local/var/run/mysqld/" does not exist on my system.
I tried to change the socket path to "__PREFIX/var/run/mysql5/ mysqld.sock" (which is where the socket is located). Unfortunately, this did not help either.
Owner and Permissions for /opt/local/var/run/mysql5/ are correctly set.
Any suggestions on how to start MySQL again? Thanks for your advice.
I use a Mac too and install MySQL from macports. I have experienced the same WTF moments you describe, and I've had to resort to this solution to restart MySQL:
# launchctl unload /Library/LaunchDaemons/org.macports.mysql5.plist
# launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
That seems wrong, too brute force. But I haven't found a better solution yet. I suggest searching ServerFault.com and see if someone else has a better method. Please post here if you do find something.
#lacopo: Why use macports? Because macports is really picky about dependencies. If you use any macports tools that depend on MySQL, it's easier to install MySQL via macports.