关于LINUX RPM的 mysql
Oct 7th, 2007 by song

好久没搞点技术东西了 今天整篇小经历

卸载MYSQL 提示有2个版本无法卸载
安装RPM 有冲突 强制安装force
rpm -i –force MySQL-server4.1.22-0.rpm
警告:MySQL-server4.1.22-0.rpm: V3 DSA 签名:NOKEY, key ID 5072e1f5
错误:失败的依赖关系:
       MySQL 与 mysql-4.1.20-1.RHEL4.1.i386 有冲突
       MySQL 与 mysql-4.1.20-1.RHEL4.1.x86_64 有冲突
       MySQL-server 与 mysql-server-4.1.20-1.RHEL4.1.x86_64 有冲突

在冲突中终于看到了关键字马上 不提示nodeps
[root@localhost ~]# rpm -e –nodeps mysql-4.1.20-1.RHEL4.1.i386
[root@localhost ~]# rpm -e –nodeps mysql-4.1.20-1.RHEL4.1.i386

[root@localhost ~]# rpm -e –nodeps mysql-server-4.1.20-1.RHEL4.1.x86_64
警告:/var/log/mysqld.log 被存为 /var/log/mysqld.log.rpmsave
看样子好像删除了

[root@localhost ~]# rpm -q mysql
软件包 mysql 没有安装

再装
[root@localhost ~]# rpm -i MySQL-server4.1.22-0.rpm                    
警告:MySQL-server4.1.22-0.rpm: V3 DSA 签名:NOKEY, key ID 5072e1f5
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h localhost.gmwin.com password ‘new-password’
See the manual for more instructions.

NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
Starting MySQL.[  OK  ]
[root@localhost ~]#
提示好像OK了

LINUX 查看本版信息
Oct 5th, 2007 by song

1) 登录到服务器执行 lsb_release -a ,即可列出所有版本信息,例如:  [root@3.5.5Biz-46 ~]# lsb_release -aLSB Version: 1.3Distributor ID: RedHatEnterpriseASDescription: Red Hat Enterprise Linux AS release 4 (Nahant Update 1)Release: 4Codename: NahantUpdate1[root@3.5.5Biz-46 ~]#


 这个命令适用于所有的linux,包括Redhat、SuSE、Debian等发行版。

2) 登录到linux执行cat /etc/redhat-release ,例如如下:  [root@3.5.5Biz-46 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 1)

[root@3.5.5Biz-46 ~]#

 这种方式下可以直接看到具体的版本号,比如 AS4 Update 1

3)登录到linux执行rpm -q redhat-release ,例如如下  [root@3.5.5Biz-46 ~]# rpm -q redhat-releaseredhat-release-4AS-2.4[root@3.5.5Biz-46 ~]#
 这种方式下可看到一个所谓的release号,比如上边的例子是2.4

这个release号和实际的版本之间存在一定的对应关系,如下:  redhat-release-3AS-1 -> Redhat Enterprise Linux AS 3redhat-release-3AS-7.4 -> Redhat Enterprise Linux AS 3 Update 4redhat-release-4AS-2 -> Redhat Enterprise Linux AS 4redhat-release-4AS-2.4 -> Redhat Enterprise Linux AS 4 Update 1redhat-release-4AS-3 -> Redhat Enterprise Linux AS 4 Update 2redhat-release-4AS-4.1 -> Redhat Enterprise Linux AS 4 Update 3redhat-release-4AS-5.5 -> Redhat Enterprise Linux AS 4 Update 4
 注意:第(2)(3)两种方法只对Redhat Linux有效

使用Perl编写CGI时需要注意的几个问题
Aug 22nd, 2007 by song

一、unix与windows下的差别

由于perl在最初是unix下的工具,现在虽然perl已经移植到流行的平台上:windows系统,但是运用起来却是有哪么一点差别,这一点需要引起我们的注意。

1、文件运算符

在unix下perl一共有27个文件运算符可以使用,这些运算符使得我们在不打开文件的情况下就可以获得文件的各种信息。但是在windows平台下,我们只能使用其中四个运算符,但万幸的是这4个运算符功能不错,基本能满足我们的需要,这就是下面的那4个运算符:

-d 测试文件是不是一个目录
-e 测试文件是否存在
-s 测试文件的大小
-w 测试文件是否是可写的

  前两个运算符返回的是布尔值(即真或假),第3个运算符返回文件的大小(以字节作为返回方式)。下面是使用方法:

if(-e ‘perl.exe’){
print ‘file size is:’-s’perl.exe’;
}
else{
print ‘can’t find perl.exen’;
}
(-w ‘somefile’)||die “cannot write to somefilen”;

2、邮件的发送 Read the rest of this entry »

PHP实现长连接
Aug 22nd, 2007 by song


[code]<?php
set_time_limit(0);
header("Connection: Keep-Alive");
header("Proxy-Connection: Keep-Alive");
for($i=0; $i<1000; $i++) {
   print 'fuck man!'.$i.'<br>';
   flush();
   sleep(3);
   clearstatcache();
}
?>[/code]

SIDEBAR
»
S
I
D
E
B
A
R
«
»  Substance:WordPress   »