【发布时间】:2013-05-22 05:01:40
【问题描述】:
我使用自制软件升级了我在 Mac OS X 10.8.3 上安装的 MySQL
brew install mysql
一切似乎都很顺利,但……事实证明并非如此。
我无法添加新用户(无论是通过命令行还是通过 phpmyadmin。我总是得到错误
Error in processing request: #2006 MySQL server has gone away
我可以毫无问题地创建新数据库,并且可以毫无问题地安装,例如 Joomla 3.1.1。
但是,当我尝试在我的 Joomla 安装中安装新扩展时,我收到错误消息。例如,当我尝试从 NoNumber 安装组件时收到以下错误:
1062 Duplicate entry '1' for key 'PRIMARY' SQL=INSERT INTO `u5z87_extensions` (`name`,`type`,`element`,`folder`,`client_id`,`enabled`,`access`) VALUES ('plg_system_nnframework','plugin','nnframework','system','0','1','1')
许多其他扩展也是如此。
我尝试用
启动mysqlmysql.server start --log-warnings=2
开始没问题
Starting MySQL
SUCCESS!
我查找了报错 #2006 的问题以及如何解决,他们提到修改 /etc/my.cnf 但我的系统上没有 /etc/my.cnf 配置文件,并且没有'不是以前安装的 MySQL 5.5.29(也安装了自制软件),我没有问题。
我跑了brew doctor,输出如下
$ brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/usr/local/opt/php54/bin/php-config
brew --config 的输出也如下:
$ brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 86ce842c700a47abdc354e80cc3b0b3938ab2132
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit nehalem
OS X: 10.8.3-x86_64
Xcode: 4.6.2
CLT: 4.6.0.0.1.1365549073
LLVM-GCC: build 2336
Clang: 4.2 build 425
X11: 2.7.4 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /Users/alisamii/.rvm/rubies/ruby-1.9.3-p374/bin/ruby
进一步探索,我尝试恢复到我之前安装的 MySQL 使用
brew switch mysql 5.5.29
这导致以下输出:
$ brew switch mysql 5.5.29
Cleaning /usr/local/Cellar/mysql/5.5.29
Cleaning /usr/local/Cellar/mysql/5.6.10
135 links created for /usr/local/Cellar/mysql/5.5.29
然后我从命令行访问 mysql 并运行 status:
mysql> status
--------------
mysql Ver 14.14 Distrib 5.5.29, for osx10.8 (i386) using readline 5.1
Connection id: 13
Current database:
Current user: alisamii@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.6.10 Source distribution
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /tmp/mysql.sock
Uptime: 1 hour 56 min 24 sec
如上所示,它报告mysql Ver 14.14 Distrib 5.5.29, for osx10.8 (i386) using readline 5.1
但是,它也写着Server version: 5.6.10 Source distribution
所以有些东西没有同步。
此外,当我显示数据库时,我得到以下输出:
mysql> show databases
-> ;
+--------------------+
| Database |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.00 sec)
但我知道我拥有的不仅仅是 information_schema 数据库。
所以,不知何故,在我看来,mysql 没有连接到正确的服务器,因为 phpmyadmin 报告的服务器信息与 mysql 的状态命令报告的服务器信息相同:Software version: 5.6.10 - Source distribution。
在这一点上,我完全迷失了,真的需要一些帮助。
【问题讨论】:
标签: mysql osx-mountain-lion homebrew mysql-error-1062 mysql-error-2006