我是 MySQL 新手,尝试从终端运行 mysql 服务器,但无法运行。这是我所做的:
1-安装mysql。
2-打开终端。
3-浏览到mysql目录/usr/local/mysql/bin并执行以下命令./mysqld --console。
4-然后我收到以下消息:
120208 3:40:55 [Warning] Can't create test file /usr/local/mysql-5.5.20-osx10.6-x86_64/data/Fareed-Rezaeis-iMac.lower-test 120208 3:40:55 [Warning] Can't create test file /usr/local/mysql-5.5.20-osx10.6-x86_64/data/Fareed-Rezaeis-iMac.lower-test 120208 3:40:55 [Note] Plugin 'FEDERATED' is disabled. ./mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 120208 3:40:55 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 120208 3:40:55 InnoDB: The InnoDB memory heap is disabled 120208 3:40:55 InnoDB: Mutexes and rw_locks use GCC atomic builtins 120208 3:40:55 InnoDB: Compressed tables use zlib 1.2.3 120208 3:40:55 InnoDB: Initializing buffer pool, size = 128.0M 120208 3:40:55 InnoDB: Completed initialization of buffer pool 120208 3:40:55 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: 'create'. InnoDB: Cannot continue operation.
PS:我尝试浏览到 /usr/local/mysql-5.5.20-osx10.6-x86_64/bin
目录,但仍然得到相同的结果。我研究并发现了一些建议,例如更改 basedir 和 datadir,但没有得到任何结果
最佳答案
这一切都与用户名有关......MySQL期望用户名是mysql,而真正的用户名是_mysql。
您只需修复与我所说的相关的权限,并且会像魅力一样工作。
关于mysql - 无法让 mysql 5.5 在 mac 10.6 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9186326/