简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM