I upgraded my installation of MySQL on my Mac OS X 10.8.3 using homebrew

brew install mysql

Everything seemed to go smoothly, but...not really, as it turns out.

I cannot add a new user (neither through the command line nor through phpmyadmin. I always get the error

Error in processing request: #2006 MySQL server has gone away

I can create new databases without a problem, and I can install, for example Joomla 3.1.1 with no problems.

However, when I try to install a new extension into my Joomla installation, I get errors. For example, I get the following error when I try to install a component from 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')

Same thing for many other extensions.

I tried to start mysql with

mysql.server start --log-warnings=2

and it started with no problem

Starting MySQL

I looked up issues where error #2006 were being reported and how to solve them, and they referred to modifying /etc/my.cnf but there is no /etc/my.cnf configuration file on my system, and there wasn't one in the previous installation of MySQL 5.5.29 (also installed with homebrew) and I had no problems.

I ran brew doctor and the output is below

$ 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:


The output from brew --config is also below:

$ brew --config
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 86ce842c700a47abdc354e80cc3b0b3938ab2132
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit nehalem
OS X: 10.8.3-x86_64
Xcode: 4.6.2
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

Exploring a little further, I tried to revert to my previous install of MySQL using

brew switch mysql 5.5.29

This resulted in the following output:

$ 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

I then accessed mysql from the command line and ran 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

As you can see above, it reports mysql Ver 14.14 Distrib 5.5.29, for osx10.8 (i386) using readline 5.1

But, it also says Server version: 5.6.10 Source distribution

So something isn't syncing up.

Furthermore, when I show databases, I get the following output:

mysql> show databases
    -> ;
| Database           |
| information_schema |
1 row in set (0.00 sec)

But I know I have more than just an information_schema database. in phpMyAdmin, I have 14 databases displaying.

So, somehow, it seems to me that mysql is not connecting to the right server, as phpmyadmin reports the same server information that mysql's status command reports: Software version: 5.6.10 - Source distribution.

At this point, I am completely lost, and would really need some help.

closed as off-topic by Shawn Melton, Max Vernon, Kin Shah, billinkc, Marian Jul 30 '15 at 14:42

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "Tip of the iceberg - the question or comments reveal an underlying issue that would need extensive investigation by a consultant or database vendor support team: issues like this do not fit the SE Q&A model well. For more information see this meta post." – Max Vernon, Kin Shah, Marian
  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Shawn Melton, billinkc
If this question can be reworded to fit the rules in the help center, please edit the question.

  • THANK YOU! This was driving me insane! Now I can create users again :) – DanielSmedegaardBuus Jun 7 '13 at 10:17

OK, so partially resolved the issue.

At the recommendation of https://dba.stackexchange.com/users/993/ypercube I read the pages related to mysql_update and followed the recommendations there.

Upgrading MySQL does not upgrade the information_schema, and so some things don't work. This command helps fix some of those issues.

Now, I can add new users and the #2006 - MySQL server has gone away error is no longer an issue.

However, I am still getting the #1062 errors when trying to install extensions in Joomla, for example. Still exploring solutions to that. Will update this answer with details when solved.


Looks like someone inserted data by hand into the primary key of u5z87_extensions, and this primary key is auto-increment, this means you are in trouble. But i think you can solve that using:

create table u5z87_extension_back like u5z87_extensions;

insert into u5z87_extension_back(all columns excluding the primary key) 
select (all columns excluding the primary key) from u5z87_extensions;

delete from u5z87_extensions;

insert into u5z87_extensions(all columns excluding the primary key)  select * from u5z87_extension_back(all columns excluding the primary key) ; 

This will work except if the table is referenced by some foreing key. Remember to do a manual backup of the table u5z87_extensions before doing this.

Good lucky!

Not the answer you're looking for? Browse other questions tagged or ask your own question.