Homebrew “brew install mysql” giving “…Error while setting value '127.0.0.1' to 'server_id'”

橙三吉。 提交于 2019-12-24 11:49:14

问题


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?


回答1:


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



回答2:


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.



来源:https://stackoverflow.com/questions/26457145/homebrew-brew-install-mysql-giving-error-while-setting-value-127-0-0-1-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!