Chinaunix首页 | 论坛 | 博客
  • 博客访问: 183602
  • 博文数量: 20
  • 博客积分: 1510
  • 博客等级: 上尉
  • 技术积分: 214
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-11 23:54
个人简介

一个异想天开的coder

文章分类

全部博文(20)

文章存档

2014年(5)

2013年(4)

2012年(2)

2011年(1)

2008年(1)

2007年(6)

2006年(1)

分类: Mysql/postgreSQL

2007-10-05 22:52:41

    这个国庆.我哪都没有去...在宿舍就摆弄mysql,以下是我的安装经过(我的安装环境是redhat 9.0)和这几天所遇到的问题:
一. 安装过程
    1.下载源代码 mysql-5.0.22.tar.gz;
    2.    >groupadd mysql;useradd -g mysql mysql
    3.运行 >tar zxvf mysql-5.0.22.tar.gz;
    4.    >cd mysql-5.0.22;
    5.运行 >./configure --prefix=/usr/local/mysql;
    6.运行 >make
    7.运行 >make install
    8.复制 >cp support-files/my_medium.cnf /etc/my.cnf
    9.    >cd /usr/local/mysql
    10.   >bin/mysql_install_db --user=mysql
    11.   >chown -R root .
    12.   >chown -R mysql var
    13.   >chgrp -R mysql .
    14.   >bin/mysqld_safe --user=mysql &
二. 设置root用户密码
1.shell>mysql -u root
2.mysql>use mysql;
3.mysql>update user set Password=PASSWORD('新密码')where User='root';
4.mysql>flush privileges;
5.mysql>quit;
然后重新登录:
6.shell>mysql -u root -p
  Enter Password:
然后出现了错误:Client does not support authentication protocol requested
by server; consider upgrading MySQL client
(其实错误提示已经说得很清楚了, 让你更新mysql 的客户端软件 )
 
在网上查了很多...这个问题也困绕了我两天,不过这也是因为我没有认真看手册的原因..以下是出现错误的解释:
 
MySQL 4.1 and up uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older clients. If you upgrade the server to 4.1, attempts to connect to it with an older client may fail with the following message:
shell>Client does not support authentication protocol requested
by server; consider upgrading MySQL client
意思是说mysql 4.1 及以更新的版本使用的验证协议是基于密码哈希算法(要想知道关于这个.请查看手册5.7.9),这跟老的客户端软件不兼容.如果你更新服务器到4.1, 用老的客户端尝试去连接它,这时就会失败并有提示信息:....
跟据提示信息,其实如果更新客户端就可以解决这个问题.如果不更新客户端就用以下方法去解决:
首先关闭服务器:
      shell>/usr/local/mysql/bin/mysqladmin -p shutdown
然后用以下方法重新启动mysqld
      shell>/usr/local/mysql/bin/mysqld_safe --user=root --skip-grant-tables &
连接服务器:
      shell>mysql -u root
 
      mysql>use mysql;
      mysql>UPDATE mysql.user SET Password=OLD_PASSWORD('你的密码')
          ->where User='root';
      mysql>flush privileges;
      mysql>quit;
然后按照上面方法重新启动mysqld服务器,如果:
shell>/usr/local/mysql/bin/mysqld_safe --user=mysql &
用mysql用户不能启动服务器,出现启动后又自动关闭时,请查看/usr/local/mysql/var/localhost.hostdomain.err文件
如果出现诸如"server stopped by localhost.hostdomain.pid"之类的信息时,在我的环境下是权限问题,只要把"/usr/local/mysql/var/"下的用户及组都改成mysql用户,mysql组就行了,这时就可以以root正常进入服务器了.
就此结束.....有问题请留言,一起探讨!!
阅读(1903) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~