sealyu

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  76 随笔 :: 82 文章 :: 17 评论 :: 0 Trackbacks

2008年7月20日 #

在RedHat AS4上安装Bugzilla时,
在安装完对应的perl模块后,在localconfig文件中配置mysql的对应信息,
继续运行checksetup.pl,出现如下错误:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

但是Mysql已经安装并且能正常运行,后来发现Bugzilla 默认检查Mysql时是使用/var/lib/mysql/mysql.sock进行连接,
而我使用源码编译安装的Mysql是使用/tmp/mysql.sock 进行连接,所以Bugzilla检查Mysql设置时会出现连接错误。
解决方法很简单:
ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
这样每次Bugzilla连接时就会使用/tmp/mysql.sock进行连接,安装成功。

posted @ 2008-07-20 23:44 seal 阅读(839) | 评论 (0)编辑 收藏

by Seal (Haibo Yu)2008-7-20


1>将mysql安装文件(本人使用mysql5.0.51a-linux-i686-glibc23.tar.gz)解压到对应目录,在此为 /home/seal/mysql

2>进入源码目录编译安装

CODE:

#cd /home/seal/mysql
#./configure --prefix=/usr/local/mysql --with-charset=gbk  |注:配置Mysql安装路径并且支持中文
#make  |注:编译
#make install  |注:编译安装

3>替换/etc/my.cnf文件,进入源码包,执行命令

CODE:

#cd /home/seal/mysql
#cp support-files/my-medium.cnf /etc/my.cnf

4>建立MySQL使用者和群组:

CODE:

#groupadd mysql
#useradd -g mysql mysql

5>完成以上操作以后进行初始化数据库,进入已经安装好的mysql目录

CODE:

#cd /usr/local/mysql
#bin/mysql_install_db --user=mysql  |注:--user=mysql 初始化表并且规定用mysql用户
6>设置给mysql和root用户设定访问权限 我们先进入mysql目录

CODE:

#cd /usr/local/mysql
#chown -R root /usr/local/mysql   |注:设定root能访问/usr/local/mysq
#chown -R mysql /usr/local/mysql/var   |注:设定mysql用户能访问/usr/local/mysql/var
#chgrp -R mysql /usr/local/mysql    |注:设定mysql组能够访问/usr/local/mysq
7>启动mysql,进入已经安装好的目录

CODE:

#cd /usr/local/mysql
#bin/mysqld_safe --user=mysql &

8>
修改mysql数据库超级用户root的缺省密码:
/usr/local/mysql/bin/mysqladmin -u root password 'mysql'

关闭mysql服务器
cd /usr/local/mysql/bin
./mysqladmin -u root -p    shutdown 

9>设定开机就启动mysql,进入源码目录下

# cd /home/seal/mysql
# cp support-files/mysql.server /etc/init.d/mysql

# chmod +x /etc/init.d/mysql
# chkconfig --level 345 mysql on
# service mysql restart
Shutting down MySQL.                                       [  确定  ]
Starting MySQL                                                [  确定  ]
[root@localhost mysql]#
10>设置Mysql远程访问:
在启动mysql后:
mysql>GRANT ALL PRIVILEGES ON *.* TO ‘myuser’@'%’ IDENTIFIED BY ‘mypassword’ WI
TH GRANT OPTION;
mysql>Flush Privileges;

安装完毕。

posted @ 2008-07-20 22:32 seal 阅读(889) | 评论 (0)编辑 收藏

在Redhat AS4上安装了MySQL后,重启后屏幕弹出几个错误对话框,而且整个UI环境为黑底,无菜单和按钮,
其中错误信息为:
Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://www.gnome.org/projects/gconf/ for information. (Details - 1: IOR file '/tmp/gconfd-root/lock/ior' not opened successfully, no gconfd located: No such file or directory 2: IOR file '/tmp/gconfd-root/lock/ior' not opened successfully, no gconfd located: No such file or directory)

出现问题的原因可能是某些配置出问题了,也有可能是系统本身出现了问题从而导致配置出错。

http://www.gnome.org/projects/gconf/上看了一下,官方解释为:

I'm having a lock file problem. What do I do?

Usually a problem here involves either NFS, or a kernel bug.

The per-user daemon locks two files in the default configuration:

   ~/.gconfd/lock/ior
~/.gconf/%gconf-xml-backend.lock/ior

The first lock is to ensure that only one gconfd is running. The second lock is to ensure only one program accesses the XML config source at a time.

If you have an NFS-mounted home directory, you must be running an rpc.statd/rpc.lockd setup on both NFS client and NFS server, so that file locking works. On Red Hat Linux, this means the "nfslock" service must be running. Enable it permanently with the chkconfig tool - see its manual page. Turn it on or off at any given time with service nfslock start or service nfslock stop. You must be root to do this.

If the kernel crashes (or the power cord gets pulled) on an NFS client machine, theoretically when you reboot the client machine it will notify the NFS server that it has rebooted and all previously-held locks should be released. However, many operating systems including Red Hat Linux 7.2 do not properly do this; so you will have stale locks after a crash. If no gconfd is running, these locks may safely be removed. If gconfd is running though, DO NOT remove them; if you have two gconfd processes for a single user, bad things may happen to that user's preferences once in a while.

没有发现解决问题的方法,后来发现,有为仁兄也碰到过类似问题,

解决方法为:

1.删除当前用户在/tmp下的相关文件: 假设用户名是root,就是这样的#rm -R *root* 。

2.删除用户主目录下的.gnome 和 .gnome2两个文件夹。 假设用户名是root,就是这样的#rm -R /root/.gnome 和#rm -R /root/.gnome2.

3.重启gnome环境,问题解决。

posted @ 2008-07-20 21:06 seal 阅读(750) | 评论 (0)编辑 收藏