QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 803|回复: 8

在安装MYSQL时遇到的问题。

[复制链接]
发表于 2005-6-21 12:53:48 | 显示全部楼层 |阅读模式
在Redhat AS 4上安装MYSQL,从网站上下载 MySQL-server-5.0.6-0.i386的gz包,解压、执行./configure,但是提示NOTE: This is a MySQL binary distribution. It's ready to run, you don't need to configure it! 既然不用配置那就直接运行吧,执行BIN目录下的MYSQL,却提示ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)      既然GZ安装不上去,那就使用RPM吧,从MYSQL网站上把RPM包下载下来,直接运行,提示安装成功,但是还是无法使用,而且LINUX在重新启动时提示MYSQL启动错误。上述方法不成功我想安装REDHAT自带的MYSQL总该可以吧,NND,还是显示ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111),不知是怎么搞的,郁闷死了,请大家指教一二。
发表于 2005-6-21 14:06:25 | 显示全部楼层
先把tar.gz的mysql的安装说明readme贴出来吧
虽然不用安装,但应该需要设置一些地方
rpm -e mysql没有?删除也是这样?
回复

使用道具 举报

 楼主| 发表于 2005-6-21 14:32:54 | 显示全部楼层
README 中的内容[MySQL is brought to you by the MySQL team at MySQL AB

For a list of developers and other contributors, see the Credits appendix
in the manual.

************************************************************

IMPORTANT:

Send bug (error) reports, questions and comments to the mailing list
at [email protected]

Please use the 'mysqlbug' script when posting bug reports or questions
about MySQL. mysqlbug will gather some information about your system
and start your editor with a form in which you can describe your
problem. Bug reports might be silently ignored by the MySQL
maintainers if there is not a good reason included in the report as to
why mysqlbug has not been used. A report that says 'MySQL does not
work for me. Why?' is not considered a valid bug report.

The mysqlbug script can be found in the 'scripts' directory of the
distribution, that is '<where-you-installed-mysql>/scripts'.]

另外,mysql的RPM包我已经删了,本来使用rpm -e mysql,提示MYSQL未安装,我昏,不过就是懒了点,双击而已,没有办法,只好从webmin中删除,然后再进行的别的尝试,使用./ mysqld_safe & 提示[4] 4762
[root@localhost bin]# Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/localhost.localdomain.pid
050621 14:29:28  mysqld ended
不知道是不是AS4本身的问题,以前使用多种LINUX系统,都没有出现这种情况,前几天使用SUSE还能成功安装,所使用的步骤和上述一模一样。
回复

使用道具 举报

发表于 2005-6-21 14:40:55 | 显示全部楼层
试试apt一个mysql如何?
它是一个下载,安装软件的下载工具,具体见我的签名
回复

使用道具 举报

 楼主| 发表于 2005-6-21 14:46:56 | 显示全部楼层
OK, I want to try it as soon as possible.
回复

使用道具 举报

发表于 2005-6-21 14:52:19 | 显示全部楼层
几分钟让你走进mysql的门----------(1)

--------------------------------------------------------------------------------


几分钟让你走进mysql的门
我电脑装上linux才一个月,特别是对rhel 4感觉很好,看过我贴的烂帖子的人,一定看得出是小菜鸟,看到网上很多姐妹对sql有兴趣(也可能是兄弟,但不是说菜鸟),反映不习惯,无从下手,看了半天书,感到很难。就装了个mysql学习一下。
我也没有专门研究过mysql,但由于以前在windows编程中常要用到sql数据库,会一些sql语法。才装上mysql,做了些摸索,行家莫笑。
1.打开mysql:
$mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.1.7

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
2.获取创建数据库及其表的权限:(这里练习,可以不用,后面用到)
mysql> grant all on samp_db.* to paul@localhost identified by "secret";
Query OK, 0 rows affected (0.10 sec)
3.创建samp_db(示例)数据库

mysql> create database samp_db;
Query OK, 1 row affected (0.06 sec)
4.使samp_db数据库成为当前数据库:
mysql> use samp_db;
Database changed
查看一下:
mysql> select database();
+------------+
| database() |
+------------+
| samp_db |
+------------+
1 row in set (0.00 sec)
5.在samp_db数据库中建立表:
mysql> create table test_tab (last_name varchar(15) not null, first_name varchar (15) not null, suffix varchar(5) null, city varchar(20) not null, state varchar( 2) not null, birth date not null, death date null );
Query OK, 0 rows affected (0.30 sec)
看看表的结构,是否符合要求:
mysql> describe test_tab;
+------------+-------------+------+-----+------------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+------------+-------+
| last_name | varchar(15) | | | | |
| first_name | varchar(15) | | | | |
| suffix | varchar(5) | YES | | NULL | |
| city | varchar(20) | | | | |
| state | char(2) | | | | |
| birth | date | | | 0000-00-00 | |
| death | date | YES | | NULL | |
+------------+-------------+------+-----+------------+-------+
7 rows in set (0.06 sec)
看看数据库中有没有其它表:
mysql> show tables;
+-------------------+
| Tables_in_samp_db |
+-------------------+
| test_tab |
+-------------------+
1 row in set (0.00 sec)
再看看有哪些数据库;
mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| samp_db |
| test |
+----------+
3 rows in set (0.00 sec)

6.试着在在表中加入一条记录:
mysql> insert into test_tab values('jinzhi','chen',null,'盐城yancheng','1','196 5.1.16',null); insert into test_tab values('jinzhi','chen',null,'盐城yancheng',
Query OK, 1 row affected (0.32 sec)
看看加入后是否符合要求:
mysql> select * from test_tab
-> ;
+-----------+------------+--------+--------------+-------+------------+-------+
| last_name | first_name | suffix | city | state | birth | death |
+-----------+------------+--------+--------------+-------+------------+-------+
| jinzhi | chen | NULL | 盐城yancheng | 1 | 1965-01-16 | NULL |
+-----------+------------+--------+--------------+-------+------------+-------+
1 row in set (0.06 sec)

mysql>
下面就看你的了
回复

使用道具 举报

发表于 2005-6-21 14:53:31 | 显示全部楼层
http://www.linuxsir.com/bbs/showthread.php?s=&threadid=96527
回复

使用道具 举报

发表于 2005-6-21 14:56:05 | 显示全部楼层
Mysql问答集(1)
==============================================
Q:在red hat linux中安裝的是 mysql-3.22.32-1.src.rpm,在連接mysql時,怎樣不用 -h 和別上root 中令.我這個不加主機名連不上.

A:mysql有一套很严格的安全机制,你要想连上远程主机,在远程主机要作相应的权限
==============================================
Q:請教各位大俠:
在安裝mysql-3.23.22-beta.tar.gz經解壓后,
./mysql.server時出現 usage: ./mysql.server start|stop 此話為何意,在開機后,怎樣啟動mysql
在用./mysql -u root 時出現 error 2002 can't connect to local mysql server throught socket 'tmp/mysql.sock'

A:你安装了mysql的基本库了吗?有个文件名叫mysql_db_install的文件,先执行一下,然后把mysql进程起起来,我没有安装过这个版本,以前的版本是运行safe_mysqld &

A:不妨装RPM包

A:我安裝的mysql-3.22.32.1.src.prm 請問,它是否包含mysql-client 和mysql-share及mysql-devel

A:不包括,你需另安装。

A:如你的mysql 安装在/mysql 下 .
加 下面的语句到/etc/rc.d/rc.local里
cd /mysql/bin ; ./safe_mysqld & > /dev/null
然后reboot 机器即可
/tmp/mysql.sock 是MYSQL 的联机套接字文件
在安装时要指定

A:如你的mysql 安装在/mysql 下 .
加 下面的语句到/etc/rc.d/rc.local里
cd /mysql/bin ; ./safe_mysqld & > /dev/null
然后reboot 机器即可
/tmp/mysql.sock 是MYSQL 的联机套接字文件
在安装时要指定

AK thanks!現在最重要事是安裝apache+PhP,總是在安裝php到make 時出錯.我后對linux重裝了,還是老毛樣.唉...

A:把他要的头文件拷贝到相应位置就可以了

=============================================================================
Q:用mysql的客户端程序工作正常,用php4连接不行,提示无去通过
/tmp/mysql.sock连接,MYSQL目录中的mysql.sock也是0字节
怎么办?我用RPM方式安装,以前一直正常,再次强行安装后MYSQL
还是不行,急!!!
apache1.3.12+php4.01pl2+mysql3.22.27
附:
Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) in test.php on line 7

A:/tmp/mysql.sock 是MYSQL 的联机套接字文件,
mysql启动后mysql.sock是0字节,这是正常的,你既然能够用客户端连上数据库那就应该不是mysql的缘故,这种情况一般是mysql的后台进程没有启起来,你可以用ps ax|grep mysql看看有没有mysql进程

A:进程已经启动,是否和我装PHP先有关系?

A:正确的安装顺序是先装mysql再装php,如果是你装反了,那再编译一次php就可以了,不过也不对啊?你如果后装的mysql,那你的php configure能通过吗??而且也没法支持mysql,那你再调用mysql的时候,php应该会提示你函数无效,而不识mysql错误啊??你的php是不是也是用rpm安装的??希望你能提供详细一点的信息??

A:my install:
gunzip apache*
gunzip php*
tar -xvf *
cd php-4.0.1pl2
./configure --with-mysql --with-apahce=../ apache --enable-track-vars
make
make install
cd ../apache_1.3.12
./configure --prefix=/server/apache --activate-module=src/modules/php4/libphp4.a
make
make install
cp ../php-4.0.1pl2/php.ini-dest /usr/local/lib/php.ini
and then edit httpd.conf about php's extentions
rpm -ivh mysql3.22.27.i386.rpm
rpm -ivh mysql-client-3.22.27.i386.rpm

A:
>my install:
>gunzip apache*
>gunzip php*
>tar -xvf *
>cd php-4.0.1pl2
>./configure --with-mysql --with-apahce=../ apache --enable-track-vars
你没有指定你的mysql目录,应该要加上--with-mysql=/the/path/to/mysql/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A:所有的问题,都源于我先安装了Apache和PHP4,再安装的MySQL。偏PHP4包含对MySQL的支持,所以在安装过程中并没有出错提示。呵呵,犯了个弱智的错误,也知道了一种出错情况的解决办法,谢谢白衣少侠

========================
Q:在安裝myodbc第二步中出現 " the requested installation information file,c:~smplstp.todbc.inf ,could not be found. The installation disks may be corrupted.
它這個~smplstp.t目錄是安裝時自動建立的,把解壓后的odbc.inf 拷至~SMPLSTP.T目錄下也出現同樣的錯誤.后?砦以傧乱粋
回复

使用道具 举报

发表于 2005-6-21 18:38:04 | 显示全部楼层
fox是好淫
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-9-24 21:19 , Processed in 0.117707 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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