编辑2012/09/18:
正如凯恩(Kane)所指出的,请确保
mysql在执行其他任何操作之前正确设置了数据库。请参阅“
mysql.server启动时PID错误?”以获取更多信息。
出于历史原因,保留了原始答案: 最有可能 是 权限问题。检查
/usr/local/var/mysql/*.err。我的说:
120314 16:30:14 InnoDB: Operating system error number 13 in a file operation.InnoDB: The error means mysqld does not have the access rights toInnoDB: the directory.InnoDB: File name ./ibdata1InnoDB: File operation call: 'open'.InnoDB: Cannot continue operation.120314 16:30:14 mysqld_safe mysqld from pid file /usr/local/var/mysql/janmoesen.local.pid ended
我还必须这样做:
sudo chown _mysql /usr/local/var/mysql/*



