Should I reinstall Mysql?

非 Y 不嫁゛ 提交于 2019-12-25 01:35:53

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/10844762/should-i-reinstall-mysql

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