3

I had MAMP successfully running in one of the user, but since I have created a new user to separate things between two developers, its throwing tantrums. I am pretty new to Mac itself but managed to find users with similar problems.

In my old user, Apache doesn't start and in the new user, MySql doesn't start. I have also verified that no other instance of mysqld is running, still it won't run MySql on my system. I have already restarted the system several times, even checked /etc for the file my.cnf, but there's no my.cnf inside /etc

Couldn't find any form to ask for a support on mamp.info and am desperately missing my Ubuntu now :-(

Here's the mysql log:

110803 16:16:26 [Note] Plugin 'FEDERATED' is disabled.
110803 16:16:26 [Note] Plugin 'ndbcluster' is disabled.
/Applications/MAMP/Library/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
110803 16:16:26 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110803 16:16:26  InnoDB: Started; log sequence number 0 396676924
110803 16:16:26 [ERROR] /Applications/MAMP/Library/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
110803 16:16:26 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
110803 16:16:26 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended

What can be the problem?

Aman Alam
  • 149
  • 1
  • 7

2 Answers2

4

This issue is related to the current user not having permissions to the file ./mysql/host.frm (/Applications/MAMP/db/mysql/mysql/host.frm)

Presumably it is because it was installed by a different user, and all files are owned by that user and write permissions are only set up for the files' owner.

In a typical MAMP installation the ownership is likely set to olduser and the admin group (olduser:admin), with only user read/write permissions. If newuser is also in the admin group then just add group read and write to the entire MAMP path:

sudo chmod -R ug+rw /Applications/MAMP

If, like in my case, the company laptop was passed from one user to the other (i.e. olduser won't be using it any more), then it might be a good idea to also change the ownership of all the files:

sudo chown -R newuser:admin /Applications/MAMP

Sidenote:

I know this is an old thread, but since it popped up now that I experienced the same issue, I figured I'd add the full solution to my own problem. Also womble's answer provided helpful insight to the root of the error.

davur
  • 191
  • 1
  • 10
3

The problem is that your MySQL data is owned by a different user than the one that is trying to access it. chown your MySQL data directory to the new user, or perhaps (if you want to continue to allow multiple people to run MySQL in the future) create a separate MySQL data directory for the new user, and modify the configuration file for the second user appropriately.

womble
  • 95,029
  • 29
  • 173
  • 228
  • this sounds nice. configuration file means `my.cnf` ? can you please tell what settings should I change in it? – Aman Alam Aug 05 '11 at 05:52
  • `datadir`, which you could have discovered by looking through your `my.cnf` for the name of your existing data directory. – womble Aug 05 '11 at 06:33