REDHAT AS4 MYSQL.5.0.27-MAX-GBLIC23 APACHE2.26 PHP5.26
整套系统安装都比较顺利,安装时采用默认的空密码,安装好后LINUX下可以正常登陆,最后修改密码,采用了几个方式(root有最高权限):
1,直接在LINUX的命令行下用mysqladmin修改,修改成功后用新密码可以进入MYSQL.
2,修改密码前先用空密码的root在LINUX下进入mysql,通过update password=''的方式修改密码,此时又用了password('新密码')和old_password('新密码')2种方法修改密码,都成功并且都能在LINUX下通过MYSQL -U -P的方式成功进入到mysql.
3,直接用phpmysql修改root密码,提示成功,再用新登陆,无法进入phpmyadmin,而LINUX下用命令可以成功登陆,
以上3种方式的最后结果:
使用PHP的mysql_connect()连接时,只提示Access denied for user 'root'@'localhost',并没提示mysql_connect()函数不存在,而且在phpinfo中能看到mysql信息,
最奇怪的是当我把root密码设为空的时候,连接正常,也能进入到phpmyadmin,一旦设置新密码,就不能通过PHP的mysql_connect()连接了,
(说明:本人很小心,所以不会出现写密码时手动输入错误,而且每种情况都尝试过好几遍),
最终我怀疑是mysql5的加密方式不同(password和old_password),但又不确定这个原因是否正确,而且2种加密方式下出现相同的结果,因为密码为空是就不存在加密的问题了,却有正常连接,希望有人或碰到过类似问题的人能帮忙解决或给个思路,谢谢!!!
4 个解决方案
#1
顶下,希望有人能知道
#2
MySQL的password()函数自从4.1开始就作了更改,变得更加安全。
Prior to MySQL 4.1, password hashes computed by the PASSWORD() function are 16 bytes long. Such hashes look like this:
mysql> SELECT PASSWORD('mypass');
+--------------------+
| PASSWORD('mypass') |
+--------------------+
| 6f8c114b58f2ce9e |
+--------------------+
The Password column of the user table (in which these hashes are stored) also is 16 bytes long before MySQL 4.1.
As of MySQL 4.1, the PASSWORD() function has been modified to produce a longer 41-byte hash value:
mysql> SELECT PASSWORD('mypass');
+-------------------------------------------+
| PASSWORD('mypass') |
+-------------------------------------------+
| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |
+-------------------------------------------+
以上例子摘自mysql手册.
password()使用新的加密方式4.1以上,包括4.1
old_password()使用旧的加密方式4.1以下
Prior to MySQL 4.1, password hashes computed by the PASSWORD() function are 16 bytes long. Such hashes look like this:
mysql> SELECT PASSWORD('mypass');
+--------------------+
| PASSWORD('mypass') |
+--------------------+
| 6f8c114b58f2ce9e |
+--------------------+
The Password column of the user table (in which these hashes are stored) also is 16 bytes long before MySQL 4.1.
As of MySQL 4.1, the PASSWORD() function has been modified to produce a longer 41-byte hash value:
mysql> SELECT PASSWORD('mypass');
+-------------------------------------------+
| PASSWORD('mypass') |
+-------------------------------------------+
| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |
+-------------------------------------------+
以上例子摘自mysql手册.
password()使用新的加密方式4.1以上,包括4.1
old_password()使用旧的加密方式4.1以下
#3
Check if you have changed your password in the right way.
#4
http://blog.chinaunix.net/u/29134/showart_373855.html
#1
顶下,希望有人能知道
#2
MySQL的password()函数自从4.1开始就作了更改,变得更加安全。
Prior to MySQL 4.1, password hashes computed by the PASSWORD() function are 16 bytes long. Such hashes look like this:
mysql> SELECT PASSWORD('mypass');
+--------------------+
| PASSWORD('mypass') |
+--------------------+
| 6f8c114b58f2ce9e |
+--------------------+
The Password column of the user table (in which these hashes are stored) also is 16 bytes long before MySQL 4.1.
As of MySQL 4.1, the PASSWORD() function has been modified to produce a longer 41-byte hash value:
mysql> SELECT PASSWORD('mypass');
+-------------------------------------------+
| PASSWORD('mypass') |
+-------------------------------------------+
| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |
+-------------------------------------------+
以上例子摘自mysql手册.
password()使用新的加密方式4.1以上,包括4.1
old_password()使用旧的加密方式4.1以下
Prior to MySQL 4.1, password hashes computed by the PASSWORD() function are 16 bytes long. Such hashes look like this:
mysql> SELECT PASSWORD('mypass');
+--------------------+
| PASSWORD('mypass') |
+--------------------+
| 6f8c114b58f2ce9e |
+--------------------+
The Password column of the user table (in which these hashes are stored) also is 16 bytes long before MySQL 4.1.
As of MySQL 4.1, the PASSWORD() function has been modified to produce a longer 41-byte hash value:
mysql> SELECT PASSWORD('mypass');
+-------------------------------------------+
| PASSWORD('mypass') |
+-------------------------------------------+
| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |
+-------------------------------------------+
以上例子摘自mysql手册.
password()使用新的加密方式4.1以上,包括4.1
old_password()使用旧的加密方式4.1以下
#3
Check if you have changed your password in the right way.
#4
http://blog.chinaunix.net/u/29134/showart_373855.html