http://dev.mysql.com/doc/mysql/en/GRANT.html http://dev.mysql.com/doc/mysql/en/FLUSH.htmle.g. GRANT ALL ON *.* TO root@localhost IDENTIFIED BY "password"; FLUSH PRIVILEGES;
是呀,用mysqlcc 修改用户密码后或新建用户,有密码的就链接不了。
我也遇到这样的问题,我用jsp连接mysql5.0,用mysql-front连接,无论怎么建立的帐号都可以登录,即使修改密码也照样登录,在cmd下面仍然可以连接上,就是通过jsp连接就出问题,我把错误代码贴出来,HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception javax.servlet.ServletException: Communication failure during handshake. Is there a server running on localhost:3306? org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800) org.apache.jsp.mysql_jsp._jspService(mysql_jsp.java:81) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) root cause java.sql.SQLException: Communication failure during handshake. Is there a server running on localhost:3306? org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:327) org.gjt.mm.mysql.Connection.connectionInit(Connection.java:261) org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Connection.java:89) org.gjt.mm.mysql.Driver.connect(Driver.java:167) java.sql.DriverManager.getConnection(Unknown Source) java.sql.DriverManager.getConnection(Unknown Source) org.apache.jsp.mysql_jsp._jspService(mysql_jsp.java:50) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) note The full stack trace of the root cause is available in the Tomcat logs. --------------------------------------------------------------------------------Apache Tomcat/5.0.16声明一下,用root登录没问题,在没有设置密码的前提下好使,给root设置密码了,怎么都连不上,同样用grant建立拥有全部权限的用户,依然不好使,但是给新建立的用户密码设置为空就都好使了,非常的不解,我在家里调试,把mysql5.0换成了4.0,基本上没有问题了,无论设置密码与否都可以连接,我感觉是mysql版本的问题,但是我还不确定,不知道有没有权威人士给解答一下,多谢了
下面这句话是说你的phpadmin应该升级客户端了,mysql 5.0的密码加密方式已升级,和原来的4.0的不一样了...Client does not support authentication protocol requested by server; consider upgrading MySQL client
当然空密码是可以访问的哈!因为password('') 结果还是空的
to loveflea(coolwind) : 麻烦您能不能把解决问题的办法说的详细点啊! 谢谢!
呵呵, 就是这个原因的. 老的客户端无法支持新的密码加密算法.将 MySQL 换为 4.0.x 版本 就 OK 了.
http://dev.mysql.com/doc/mysql/en/FLUSH.htmle.g.
GRANT ALL ON *.* TO root@localhost IDENTIFIED BY "password";
FLUSH PRIVILEGES;
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.mysql_jsp._jspService(mysql_jsp.java:81)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
root cause java.sql.SQLException: Communication failure during handshake. Is there a server running on localhost:3306?
org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:327)
org.gjt.mm.mysql.Connection.connectionInit(Connection.java:261)
org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Connection.java:89)
org.gjt.mm.mysql.Driver.connect(Driver.java:167)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
org.apache.jsp.mysql_jsp._jspService(mysql_jsp.java:50)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.
--------------------------------------------------------------------------------Apache Tomcat/5.0.16声明一下,用root登录没问题,在没有设置密码的前提下好使,给root设置密码了,怎么都连不上,同样用grant建立拥有全部权限的用户,依然不好使,但是给新建立的用户密码设置为空就都好使了,非常的不解,我在家里调试,把mysql5.0换成了4.0,基本上没有问题了,无论设置密码与否都可以连接,我感觉是mysql版本的问题,但是我还不确定,不知道有没有权威人士给解答一下,多谢了
麻烦您能不能把解决问题的办法说的详细点啊!
谢谢!
就是这个原因的.
老的客户端无法支持新的密码加密算法.将 MySQL 换为 4.0.x 版本 就 OK 了.