2011-01-25 3 views
11

Snow Leopard에 MySQL5를 설치하려고하는데 문제가 있습니다. 여기 내 터미널 로그입니다! 나는 내 디스크 권한 복구 시도했지만 아무것도 작동하는 것 같다되지MacPorts를 사용하여 Snow Leopard에 MySQL 설치

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을 활용하는 방법에 대한 조언 감사하겠습니다

답변

39

이 시도 : 루트 암호를 설정하는 문제가 발생하는 경우

sudo chown -R mysql:mysql /opt/local/var/db/mysql5 
sudo chmod u+rwx,go= /opt/local/var/db/mysql5 
sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql 

가 여기에있는 지침을 사용하여 재설정 :를 시작하고 나는 다음과 같은 별칭을 사용하는 MySQL의 데몬을 정지 223,210

:

alias mysql_start='sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper start'; 
alias mysql_stop='sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper stop'; 
alias mysql_restart='sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper restart'; 

행운을 빕니다!

+1

내 생명의 은인! – holms

+0

+1의 별칭입니다. 그 래퍼 스크립트에 대해 몰랐다. – JCotton

-2

를 사용하지 왜 dmg image

+1

시도해 보았습니다. 어떤 이유로 든 시작할 수 없었습니다. – Hanpan

+1

이유가없는 제안이별로 유용하지 않기 때문에 하향 투표 됨. –

1

Reimund의 대답은 비슷한 문제였습니다. 해결되지 않았습니다. 그러나 첫째 root로 실행 :

sudo mysql_install_db --user=root 

을 그들은이어야하는 권한을 설정 :

sudo chown -R mysql:admin /opt/local/var/db/mysql5 
sudo chmod u+rwx,go= /opt/local/var/db/mysql5 

트릭을했다.

관련 문제