I installed MySQL on my personal / development machine using the .dmg package, as instructed here: http://dev.mysql.com/doc/refman/5.5/en/macosx-installation-pkg.html , including installation launch item and settings panel. And yet, I cannot use MySQL at all.
works:
/Library/StartupItems/MySQLCOM/MySQLCOM start
or
/Library/StartupItems/MySQLCOM/MySQLCOM restart
"works" - in this he gives me a message like "Starting the MySQL database server", but then I still can’t enter mysql on the command line or connect to it in Rails 2.3.8 application running in script / server. I get the error indicated in the title of the question.
In addition, the MySQL settings panel does not work either. If I click the "Start MySQL Server" button, they will ask me to enter my password, but then nothing will happen - the panel continues to say that the server is stopped.
(I believe that I had a version of MySQL for MacPorts installed earlier, and it is also possible that there was one source in the past, but I'm sure I deleted them and deleted all the files associated with it that I could find. )
I am also trying mysqld start in terminal. here is the conclusion:
110127 15:40:28 [Warning] Can't create test file /usr/local/mysql-5.5.8-osx10.6-x86_64/data/Lucky-Charm.lower-test 110127 15:40:28 [Warning] Can't create test file /usr/local/mysql-5.5.8-osx10.6-x86_64/data/Lucky-Charm.lower-test 110127 15:40:28 [Note] Plugin 'FEDERATED' is disabled. mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 110127 15:40:28 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Compressed tables use zlib 1.2.3 110127 15:40:28 InnoDB: Initializing buffer pool, size = 128.0M 110127 15:40:28 InnoDB: Completed initialization of buffer pool 110127 15:40:28 InnoDB: Operating system error number 13 in a file operation. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. InnoDB: File name ./ibdata1 InnoDB: File operation call: 'open'. InnoDB: Cannot continue operation.
Tried to follow mysql_upgrade start message, but this again gives me the original error.
UPDATE:
OK. I pursued the theory that this is a permission issue. Seeing that datadir belongs to root, I chown -R is _mysql. In response to Mike, here where he stands now:
$ ls -al /usr/local/mysql-5.5.8-osx10.6-x86_64 total 296 drwxr-xr-x 16 root wheel 544 Dec 3 12:53 . drwxrwxr-x 12 root staff 408 Jan 27 14:38 .. -rw-r--r-- 1 root wheel 17987 Dec 3 11:58 COPYING -rw-r--r-- 1 root wheel 12388 Dec 3 11:58 INSTALL-BINARY -rw-r--r-- 1 root wheel 113534 Dec 3 11:58 README drwxr-xr-x 44 root wheel 1496 Dec 3 12:53 bin drwxr-xr-x 9 _mysql wheel 306 Jan 27 16:46 data drwxr-xr-x 4 root wheel 136 Dec 3 12:53 docs drwxr-xr-x 47 root wheel 1598 Dec 3 12:53 include drwxr-xr-x 12 root wheel 408 Jan 27 14:38 lib drwxr-xr-x 4 root wheel 136 Dec 3 12:53 man drwxr-xr-x 19 root wheel 646 Jan 27 14:38 mysql-test drwxr-xr-x 3 root wheel 102 Dec 3 12:53 scripts drwxr-xr-x 32 root wheel 1088 Dec 3 12:53 share drwxr-xr-x 28 root wheel 952 Dec 3 12:53 sql-bench drwxr-xr-x 16 root wheel 544 Dec 3 12:53 support-files
I tried to make mysqld start in the terminal because it was the only thing that gave me something that seemed to be meaningful output of error messages (see https://gist.github.com/799436 ), but in #mysql they told me that it is not intended to be run directly (and if I try sudo mysqld start , I get a message embroidering me from trying to start mysql as root).
Something seems to be working for me now: mysqld_safe & successfully starts the MySQL server. What else does not work is the "normal" method of starting the server (the "Start" or "Settings" element)
... leading someone in #mysql to tell me that apparently MySQL is ok, this is the startup item that is borked.