mac上mysql打开错误

Unhandled exception: Wrong number or type of arguments for overloaded function 'TextBox_append_text_with_encoding'.

  Possible C/C++ prototypes are:

    mforms::TextBox::append_text_with_encoding(std::string const &,std::string const &,bool)

    mforms::TextBox::append_text_with_encoding(std::string const &,std::string const &)


本地 MySQL服务器不能打开了。通过 phpMyAdmin登录后台却提示我「#2002 无法登录 MySQL服务器」。

201307311

尝试通过终端启动 mysql服务也失败了,各种命令都敲遍了,提示我「The server quit without updating PID file(…)」还有「The /usr/local/mysql/data directory is not owned by the ‘mysql’ or ‘_mysql’ user」之类等等。

最后,终于,找到了原因…

Mac OS X的升级或者其他原因可能会导致 MySQL启动或者开机自动运行,在 MySQL的操作面板上会提示「Warning:The /usr/local/mysql/data directory is not owned by the ‘mysql’ or ‘_mysql’」,或者在命令行下提示「Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’」

这应该是某种情况下导致 /usr/local/mysql/data 的宿主发生了改变,只需要运行「sudo chown -R mysql /usr/local/mysql/data」,然后终端重启 Apache,再运行「sudo /usr/local/mysql/support­files/mysql.server start」即可重新开启 MySQL服务器。

201307312

另外,虽然下面这个问题我还没遇到,不过貌似也是 Mac OS X下会出现的情况,留着以后说不定用得上:

使用 PHP连接 MySQL可能会报错「Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’」,或者使用localhost无法连接MySQL而需要127.0.0.1,原因是连接时候php默认去找 /var/mysql/mysql.sock 了,但是MAC版本的MYSQL改动了文件的位置,放在/tmp下了。处理办法是按如下修改php.ini:

mysql.default_socket = /tmp/mysql.sock

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值