LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1025|回复: 3

linux 下安装mysql不能启动问题

[复制链接]
发表于 2005-9-8 21:19:23 | 显示全部楼层 |阅读模式
以源码包安装的
安装过程如下

shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root  .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &


安装结束后进入mysql目录下
运行shell>bin/mysqld_safe --user=mysql

或者shell>bin/mysqld_safe --user=mysql &
都提示

STOPPing server from pid file  /usr/local/mysql/var/server.pid
mysqld  end

bin/mysqladmin -u root password 'mysql'
提示
error  can not connect to local MYSQL server through socket 'tmp/mysql.sock' (2)


请教该怎么办?

感谢
发表于 2005-9-9 14:01:51 | 显示全部楼层
是mysql.sock的问题, 在/tmp下没有这个socket文件, 看下my.cnf, 看看是设定在哪里了. 如果直接拷贝过来也可以用, 不过/tmp目录会定时清除.
回复 支持 反对

使用道具 举报

发表于 2005-9-9 14:20:56 | 显示全部楼层
另外查看日志
回复 支持 反对

使用道具 举报

发表于 2005-9-9 15:14:50 | 显示全部楼层
我的也出现同样的错误,按楼上的提示找到了my.cnf,看到里面的内容如下:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

好像/var/lib/mysql/中没有这个mysql.sock


打开log,内容如下:
050906 14:13:01  mysqld started
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
050906 14:13:02  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
050906 14:13:02  InnoDB: Log file ./ib_logfile0 did not exist: new to be createdInnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
050906 14:13:03  InnoDB: Log file ./ib_logfile1 did not exist: new to be createdInnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
050906 14:13:04  InnoDB: Started; log sequence number 0 0
/usr/libexec/mysqld: ready for connections.
Version: '4.1.11'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
050906 14:21:06 [Note] /usr/libexec/mysqld: Normal shutdown

050906 14:21:06  InnoDB: Starting shutdown...
050906 14:21:08  InnoDB: Shutdown completed; log sequence number 0 43634
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表