我是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,但没有得到任何结果
答案 0 :(得分:2)
全部关于用户名... MySQL期望用户名为mysql,而真实用户名为_mysql。
你只需修复与我所说的相关的权限,并将像魅力一样工作。