我只是删除和重新安装雪豹。 我安装了64位的MySQL 5.1.48清理。 我与MySQL服务器有问题…当我启动计算机并login时,服务器没有运行。 我试图通过点击“启动MySQL服务器”使用偏好窗格来启动它,但它所做的只是突出显示button蓝色,然后想一分钟,然后button恢复正常,什么也没有发生。
然后我试着从terminal开始:
Hristo$ sudo /usr/local/mysql/support-files/mysql.server start Starting MySQL .................................................................................................... ERROR! Manager of pid-file quit without updating file.
所以我查了一下状态:
Hristo$ sudo /usr/local/mysql/support-files/mysql.server status Password: /usr/local/mysql/support-files/mysql.server: line 418: pidof: command not found ERROR! MySQL is not running
我试过这个:
Hristo$ /usr/local/mysql/bin/mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
所以我不知道该怎么做。 今天早些时候,服务器正在工作,但我去偏好窗格试图阻止它…发生同样的事情…我点击“停止Mysql服务器”button,它做了一些思考,然后什么也没有。 所以我重新启动了计算机,现在我遇到了上述问题,显然,mysql.sock文件不在/ tmp /中了…现在是早些时候了。
有任何想法吗?
谢谢,Hristo
更新2:错误日志文件:
100701 13:27:03 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 100701 13:27:03 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive 100701 13:27:03 [Note] Plugin 'FEDERATED' is disabled. InnoDB: Unable to lock ./ibdata1, error: 35 InnoDB: Check that you do not already have another mysqld process InnoDB: using the same InnoDB data or log files. 100701 13:27:03 InnoDB: Retrying to lock the first data file InnoDB: Unable to lock ./ibdata1, error: 35 InnoDB: Check that you do not already have another mysqld process InnoDB: using the same InnoDB data or log files. InnoDB: Unable to lock ./ibdata1, error: 35
这重复了一段时间,然后…
InnoDB: using the same InnoDB data or log files. InnoDB: Unable to lock ./ibdata1, error: 35 InnoDB: Check that you do not already have another mysqld process InnoDB: using the same InnoDB data or log files. 100701 13:28:43 InnoDB: Unable to open the first data file InnoDB: Error in opening ./ibdata1 100701 13:28:43 InnoDB: Operating system error number 35 in a file operation. InnoDB: Error number 35 means 'Resource temporarily unavailable'. InnoDB: Some operating system error numbers are described at InnoDB: http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html InnoDB: Could not open or create data files. InnoDB: If you tried to add new data files, and it failed here, InnoDB: you should now edit innodb_data_file_path in my.cnf back InnoDB: to what it was, and remove the new ibdata files InnoDB created InnoDB: in this failed attempt. InnoDB only wrote those files full of InnoDB: zeros, but did not yet use them in any way. But be careful: do not InnoDB: remove old data files which contain your precious data! 100701 13:28:43 [ERROR] Plugin 'InnoDB' init function returned error. 100701 13:28:43 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 100701 13:28:43 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use 100701 13:28:43 [ERROR] Do you already have another mysqld server running on port: 3306 ? 100701 13:28:43 [ERROR] Aborting 100701 13:28:43 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete 100701 13:28:43 mysqld_safe mysqld from pid file /usr/local/mysql/data/pid_file.pid ended
更新:试图用sudo sh -x启动MySQL之后
Hristo$ sudo sh -x /usr/local/mysql/support-files/mysql.server start + basedir= + datadir= + service_startup_timeout=900 + pid_file= + server_pid_file= + use_mysqld_safe=1 + user=mysql + test -z '' + basedir=/usr/local/mysql + bindir=./bin + test -z '' + datadir=/usr/local/mysql/data + sbindir=./bin + libexecdir=./bin + datadir_set= + lsb_functions=/lib/lsb/init-functions + test -f /lib/lsb/init-functions + PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/mysql/bin + export PATH + mode=start + shift + other_args= + case `echo "testing\c"`,`echo -n testing` in ++ echo 'testing\c' ++ echo -n testing + echo_n= + echo_c='\c' + test -x ./bin/my_print_defaults + print_defaults=./bin/my_print_defaults + extra_args= + test -r /usr/local/mysql/my.cnf + test -r /usr/local/mysql/data/my.cnf ++ ./bin/my_print_defaults mysqld server mysql_server mysql.server + parse_server_arguments ++ ./bin/my_print_defaults manager + parse_manager_arguments + test -z '' ++ /bin/hostname + pid_file=/usr/local/mysql/data/mysqlmanager-pid_file.pid + test -z '' ++ /bin/hostname + server_pid_file=/usr/local/mysql/data/pid_file.pid + case "$mode" in + cd /usr/local/mysql + manager=./bin/mysqlmanager + test -x ./bin/mysqlmanager + manager=./bin/mysqlmanager + echo 'Starting MySQL' Starting MySQL + test -x ./bin/mysqlmanager -a 1 = 0 + test -x ./bin/mysqld_safe + pid_file=/usr/local/mysql/data/pid_file.pid + wait_for_pid created 23653 + verb=created + manager_pid=23653 + i=0 + avoid_race_condition='by checking again' + test 0 -ne 900 + case "$verb" in + test -s /usr/local/mysql/data/pid_file.pid + test -n 23653 + kill -0 23653 + : + echo '.\c' .+ ./bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/pid_file.pid ++ expr 0 + 1 + i=1 + sleep 1 + test 1 -ne 900 + case "$verb" in + test -s /usr/local/mysql/data/pid_file.pid + test -n 23653 + kill -0 23653 + : + echo '.\c' .++ expr 1 + 1 + i=2 + sleep 1 + test 2 -ne 900 + case "$verb" in + test -s /usr/local/mysql/data/pid_file.pid + test -n 23653 + kill -0 23653 + :
这重复了很长一段时间…
+ echo '.\c' .++ expr 97 + 1 + i=98 + sleep 1 + test 98 -ne 900 + case "$verb" in + test -s /usr/local/mysql/data/pid_file.pid + test -n 23653 + kill -0 23653 + : + echo '.\c' .++ expr 98 + 1 + i=99 + sleep 1 + test 99 -ne 900 + case "$verb" in + test -s /usr/local/mysql/data/pid_file.pid + test -n 23653 + kill -0 23653 + : + echo '.\c' .++ expr 99 + 1 + i=100 + sleep 1 + test 100 -ne 900 + case "$verb" in + test -s /usr/local/mysql/data/pid_file.pid + test -n 23653 + kill -0 23653 + test -n 'by checking again' + avoid_race_condition= + continue + test 100 -ne 900 + case "$verb" in + test -s /usr/local/mysql/data/pid_file.pid + test -n 23653 + kill -0 23653 + test -n '' + log_failure_msg 'Manager of pid-file quit without updating file.' + echo ' ERROR! Manager of pid-file quit without updating file.' ERROR! Manager of pid-file quit without updating file. + return 1 + return_value=1 + test -w /var/lock/subsys + exit 1
您是否检查了要创buildPID文件的目录的权限(/ var / run或是什么)?
在my.cnf中也可能是错误的选项。 试着在没有my.cnf的情况下启动MySQL(重命名它),或者注释掉除了绝对必要的选项以外的所有内容。
有几个可能的原因,在你的问题中没有足够的信息让我们确定你的问题的原因。
尤其是:
你是如何安装MySQL的? 你使用了一个包吗? 如果是这样,哪一个? 还是你从源头上build立?
这里有一些build议:
如果您将启动命令更改为:
sudo sh -x /usr/local/mysql/support-files/mysql.server start
你会看到脚本执行的每一个命令,这会给你(我们)帮助理解事情发生错误的地方。
在我的OSX 10.5安装中,/ usr / local / mysql下的所有东西都拥有root:wheel, 除了 / usr / local / mysql / data这个是_mysql:wheel。 这可能是最常见的mysql启动问题。
错误日志很可能是信息性的,可能在/usr/local/mysql/data/HOSTNAME.errfind。
这应该足以让你为自己解决问题。 如果没有,回答我的问题,并发布您的日志,我们可以从那里去。
如果你从DMG安装,有一个启动脚本随它一起,你双击它?
好吧,该脚本安装在/ Library / StartupItems / MySQLCOM的东西
而不是做mysql.server尝试开始/停止。 我知道它所做的只是调用mysql.server,但我想知道是否一切确实安装正确或不。 以下是从DMG自述文件粘贴的副本。
如果您安装了启动项目,请使用以下命令:
shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM start (ENTER YOUR PASSWORD, IF NECESSARY) (PRESS CONTROL-D OR ENTER "EXIT" TO EXIT THE SHELL)
如果您不使用启动项目,请input以下命令序列:
shell> cd /usr/local/mysql shell> sudo ./bin/mysqld_safe (ENTER YOUR PASSWORD, IF NECESSARY) (PRESS CONTROL-Z) shell> bg (PRESS CONTROL-D OR ENTER "EXIT" TO EXIT THE SHELL)