易截截图软件、单文件、免安装、纯绿色、仅160KB

mysql用户认证协议更换(mysql使用问题)

安装好mysql后,在使用mysq时,出现了如下问题.
java.sql.SQLException: Communication failure during handshake. Is there a server running on localhost:3306?
at org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:327)
at org.gjt.mm.mysql.Connection.connectionInit(Connection.java:261)
at org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Connection.java:89)
at org.gjt.mm.mysql.Driver.connect(Driver.java:167)
at java.sql.DriverManager.getConnection(DriverManager.java:523)
MYSQL 4.1以后, 采用了一种新的用户认证协议, 对于老的客户端会出现不支持认证协议的错误, 以下是官方网站的解决方法﹔
1When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.
使用以前建立的账号连接,对于在新的认证协议下建立的账户就不行了
3Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function: mysql> SET PASSWORD FOR 
-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');
Alternatively, use UPDATE and FLUSH PRIVILEGES: mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd') -> WHERE Host = 'some_host' AND User = 'some_user'; 
mysql> FLUSH PRIVILEGES;
Substitute the password you want to use for ``newpwd'' in the preceding examples. MySQL cannot tell you what the original password was, so you'll need to pick a new one.
这是一个不错的办法,新建立的账号采用老式的加密协议
4Tell the server to use the older password hashing algorithm: 
Start mysqld with the --old-passwords option.
这样新认证协议的优点就没法使用了
5Assign an old-format password to each account that has had its password updated to the longer 4.1 format. You can identify these accounts with the following query: mysql> SELECT Host, User, Password from mysql.user 
-> WHERE LENGTH(Password) > 16;
For each account record displayed by the query, use the Host and User values and assign a password using th


相关文档:

MySQL导出导入命令

      默认导出到当前目录中     
  1.导出整个数据库
  mysqldump -u 用户名 -p 数据库名 > 导出的文件名
  mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
  2.导出一个表
  mysqldump -u 用户名 -p 数据库名 表名> 导出的文件名
  mysqldum ......

OracleDB,MySQL字符串操作函数INSTR,SUBSTRING_INDEX

题目:给定一个分割符,怎样得到给定字符串最后一个分割符后的字符串。 如:‘fsb-ibees-zxj-fsbk’ 怎样得到fsbk, 要求:java实现,sql实现?sql可以是oracle,mysql等实现。
 1.Oracle实现
SET SERVEROUTPUT ON;
DECLARE
str VARCHAR2(266):='123-890-ibees-zxj';--被解析的字符串
splitStr VARCH ......

mysql substring

得安奇专卖(运动休闲鞋,板鞋)淘宝小店:www.bxbshoes.com
substring:
语法
SUBSTRING ( expression , start , length )   
参数
expression     
是字符串、二进制字符串、text、image、列或包含列的表达式。不要使用包含聚合函数的 ......

mysql中IN子查询排序

这几天做一个查询,需要在一个指定的结果集中进行查询,例如:
select * from table_name where doc_id IN ('1dba', 'c20a', '907b')
其中IN子句中的doc_id列表是通过调用一个外部接口获得一组doc_id常量列表,然后在本地库中搜索符合这个列表的数据
记录。后来发现mysql返回的结果集的排序是按照入库顺序给出的,但是我 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号