使用 MacPorts 在 Snow Leopard 上安装 MySQL
我正在尝试在 Snow Leopard 上安装 MySQL5,但遇到了一些问题。这是我的终端日志:
users-MacBook-Pro:~ sam$ sudo port install mysql5Password:
---> Computing dependencies for mysql5
---> Fetching mysql5
---> Verifying checksum(s) for mysql5
---> Extracting mysql5
---> Applying patches to mysql5
---> Configuring mysql5
---> Building mysql5
---> Staging mysql5 into destroot
---> Installing mysql5 @5.1.53_0
The MySQL client has been installed.
If you also want a MySQL server, install the mysql5-server port.
---> Activating mysql5 @5.1.53_0
---> Cleaning mysql5
users-MacBook-Pro:~ sam$ sudo port install mysql5-server
Password:
---> Computing dependencies for mysql5-server
---> Fetching mysql5-server
---> Verifying checksum(s) for mysql5-server
---> Extracting mysql5-server
---> Configuring mysql5-server
---> Building mysql5-server
---> Staging mysql5-server into destroot
---> Creating launchd control script
###########################################################
# A startup item has been generated that will aid in
# starting mysql5-server with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo port load mysql5-server
###########################################################
---> Installing mysql5-server @5.1.53_0
******************************************************
* In order to setup the database, you might want to run
* sudo -u _mysql mysql_install_db5
* if this is a new install
******************************************************
---> Activating mysql5-server @5.1.53_0
---> Cleaning mysql5-server
users-MacBook-Pro:~ sam$ sudo chmod -Rf 777 /opt/local/var/db/mysql
chmod: /opt/local/var/db/mysql: No such file or directory
users-MacBook-Pro:~ sam$ sudo chmod -Rf 777 /opt/local/var/db/mysql5
users-MacBook-Pro:~ sam$ sudo -u _mysql mysql_install_db5
Installing MySQL system tables...
ERROR: 1004 Can't create file '/var/tmp/#sqlf2ef_1_0.frm' (errno: 9)
110125 20:22:45 [ERROR] Aborting
110125 20:22:45 [Note] /opt/local/libexec/mysqld: Shutdown complete
Installation of system tables failed! Examine the logs in
/opt/local/var/db/mysql5 for more information.
You can try to start the mysqld daemon with:
shell> /opt/local/libexec/mysqld --skip-grant &
and use the command line tool /opt/local/lib/mysql5/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /opt/local/lib/mysql5/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /opt/local/var/db/mysql5 that may be helpful.
Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the /opt/local/lib/mysql5/bin/mysqlbug script!
我已尝试修复我的磁盘权限,但似乎没有任何效果:( 如果有任何关于如何启动和运行 MySQL 的建议,我将不胜感激!
I am trying to install MySQL5 on Snow Leopard, but I am having some trouble. Here is my terminal log:
users-MacBook-Pro:~ sam$ sudo port install mysql5Password:
---> Computing dependencies for mysql5
---> Fetching mysql5
---> Verifying checksum(s) for mysql5
---> Extracting mysql5
---> Applying patches to mysql5
---> Configuring mysql5
---> Building mysql5
---> Staging mysql5 into destroot
---> Installing mysql5 @5.1.53_0
The MySQL client has been installed.
If you also want a MySQL server, install the mysql5-server port.
---> Activating mysql5 @5.1.53_0
---> Cleaning mysql5
users-MacBook-Pro:~ sam$ sudo port install mysql5-server
Password:
---> Computing dependencies for mysql5-server
---> Fetching mysql5-server
---> Verifying checksum(s) for mysql5-server
---> Extracting mysql5-server
---> Configuring mysql5-server
---> Building mysql5-server
---> Staging mysql5-server into destroot
---> Creating launchd control script
###########################################################
# A startup item has been generated that will aid in
# starting mysql5-server with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo port load mysql5-server
###########################################################
---> Installing mysql5-server @5.1.53_0
******************************************************
* In order to setup the database, you might want to run
* sudo -u _mysql mysql_install_db5
* if this is a new install
******************************************************
---> Activating mysql5-server @5.1.53_0
---> Cleaning mysql5-server
users-MacBook-Pro:~ sam$ sudo chmod -Rf 777 /opt/local/var/db/mysql
chmod: /opt/local/var/db/mysql: No such file or directory
users-MacBook-Pro:~ sam$ sudo chmod -Rf 777 /opt/local/var/db/mysql5
users-MacBook-Pro:~ sam$ sudo -u _mysql mysql_install_db5
Installing MySQL system tables...
ERROR: 1004 Can't create file '/var/tmp/#sqlf2ef_1_0.frm' (errno: 9)
110125 20:22:45 [ERROR] Aborting
110125 20:22:45 [Note] /opt/local/libexec/mysqld: Shutdown complete
Installation of system tables failed! Examine the logs in
/opt/local/var/db/mysql5 for more information.
You can try to start the mysqld daemon with:
shell> /opt/local/libexec/mysqld --skip-grant &
and use the command line tool /opt/local/lib/mysql5/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /opt/local/lib/mysql5/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /opt/local/var/db/mysql5 that may be helpful.
Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the /opt/local/lib/mysql5/bin/mysqlbug script!
I have tried repairing the my disks permissions but nothing seems to work :( Would appreciate any advice on how to get MySQL up and running!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
试试这个:
如果您在设置 root 密码时遇到问题,请使用此处的说明重置它:http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-unix
用于启动和停止我使用的 mysql 守护进程以下别名:
祝你好运!
Try this:
If you're having problem setting the root password, reset it using the instructions found here: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-unix
For starting and stopping the mysql daemon I use the following aliases:
Best of luck!
我有一个类似的问题,雷蒙德在这里的回答没有解决它。但是,首先以
root
身份运行:然后按应有的方式设置权限:
就成功了。
I had a similar issue, Reimund's answer here didn't solve it. However, first running as
root
:then setting the permissions as they should be:
did the trick.
为什么不尝试使用 dmg 映像
Why not try using the dmg image