一个月的校园生活感想

作者 chmhiee   于 2004-3-18 14:54:10 发表在 社会透视

一个偶然的机会,我被聘为浙江三十二所大专院校之一的院校里担任班主任,我带的是计算机系一年级的三个班。人数是120人。
2月16日来到学校,学校第一天上课,到教室一看,三个班到教室听课的还不到三十人。我问人到哪里去了,系主任回答说有的在外面网巴玩,大多数人还在睡觉。班主任的责任就是保证学生的到课率和自修率,保证学生安全和不出意外。来到宿舍,学生都躺在床上,问他们上课间怎么还睡?有的说没兴趣,课听不懂。有的说我们交足了学费,上不上课是我们的自由。费了好大劲把他们叫起来,到教室一看,三个班最多只增加了十几个人,大多数吃了早饭又回去睡,有的干脆到外面玩去了。
经过了解,我明白了其中的原因。这批学生大多数来自于温州、宁波和杭州的富家之弟,平时热衷于玩电脑游戏,以为计算机就是玩电脑,一遇的高等数学和外语这些课,他们根本没有希望拿到学分,把学校当作疗养院一样的自由空间,反正父母有钱,以后接父母的班做生意,不怕找不到工作。学校也针对家长望子成龙的心情,大量找收富家子弟,难怪有人说,“别看这些学生难管,他们是上帝,是他们养活了你们。”三个班中有一部分学生是来拼文凭的,他们高考落榜,到民办学校来镀金,他们有一定的自控能力,有学分的课就上,没学分的课就不上;有一部分学生纯粹是父母叫学校来管管的,家长忙着做生意,怕子女在外面闯祸,还不如接受一下学园生活的熏陶。这些学生对学习根本不感兴趣,成天泡在网巴里,120人中有60多人代管费没交,多数把钱用了,别说听课做作业了;大多数学生是想碰运气的,最好是天上掉下一张文凭。他们学习基础差,学习氛围好,他们就能努力跟,学习氛围差,他们也就随大流。别人睡觉他们也睡觉,上课人少他们也不去听课。考试时能作弊就作弊,不能作弊下次再补考。
我把工作重点放在抓两头上,把一些有能力有学习基础的学生作为班干部,对他们严格要求。对个别实在不想学习、影响学习风气的违纪学生进行处分。以正面教育为主,启发学生的自尊自爱,要求培养良好的学习风气和生活习惯。人都是通情达理的,只要我们真诚地对待他们,他们也会相信你、尊重你。班里的风气有了好转,到课率和自修率也有了提高。当然,我的工作与系领导和院领导的步调不可能一致,我被解聘了。沉重的事务把我也拖累了,我得到了解脱,我从角色又回到了自我。
教育是一件大事,他牵涉到培养什么样的人,树立什么样的风气,形成什么样的社会的大事。但社会缺乏根基,国家缺乏理念,教育缺乏方针,整个校园充满了铜臭味。学校成了榨钱的机器,学费、住宿费、代管费、食堂、小卖店都向学生头上压来,有人说,学生的钱最好挣,特别是温州学生。学生被商品经济严重污染,到处是手机的短信息,到处是人际关系的等价交换,到处是谈情说爱和网络游戏。在这里,我看不到淳朴和专注,看不到关怀和友谊,看不到个性的发展和真理的追求。哀者!中国向何处去?

有一个号码可以让你取消手机的任何服务项目
其实早就有那么一个短信内容让你可以取消你订购的服务或者强加给你的服务,内容就是“0000”四个零,  那发送给谁呢?  这个问题问的太专业了,发送给谁呢,其实发送的号码就是你订购服务的号码,或者是*商硬家给你的号码,如果不知道可以到相关的网站去查,可以看看订购此服务的号码就是了,现在你就可以试试,比如你想取消qq上的某些或所有服务,你就发送“0000”到“1700”上去,马上就有回复,让你选择取消的服务,格式是“qx+数字”,其中“0”是取消所有服务,也就是你发送“qx0”就取消的qq的所有收费服务,其实这是国家给这些短信服务js订的规矩,但是他们害怕大家知道,谁也不告诉大家应该享受的权利,现在好了,我告诉大家了,其实我是从一个做短信的朋友那里得来的,希望大家广泛传播,让js不能得逞,有圈扔圈吧。希望能解除大家的难言之隐,呵呵。  记住发送“0000”(四个零,不是四个欧)到相应号码,随后按回复的短信去做就可以了。

取消服务的通用码有两个:"0000"和"00000",就是4个零和5个零。所有的短信服务
商都默认使用两个代码作为取消服务的代码(虽然很多时候他们自己会制定各项服务的
取消代码),因为这是国家相关管理部门规定的。只要你发送这两个代码之一到服务商
的号码处(就是发短信给你的那个号码的前四位),就可以取消服务。

很多人也问到4个零和5个零有什么区别?是这样的,"0000"(4个零)是提请取消服
务代码,当服务商收到这个代码后,他会检查你的手机号码在他那里订制了什么服务,
然后会把你订制的服务及取消方法发给你,你必须按照他所说的办法再发送取消代码才
能取消具体的某项服务。而"00000"(5个零)则是无条件取消所有服务的代码,当服务
商收到该代码,就必须取消你的手机在他那里定制的全部服务,同时反馈已取消所有服
务的信息给用户。

所以说4个零适合于单独取消服务商的单个服务,比如说你的手机在腾讯(1700)上
订制了移动QQ,QQ交友两个服务,而你又只想取消QQ交友而不想取消移动QQ,那么就应
该发送"0000"到1700,然后根据1700发过来的提示来取消QQ交友。如果你是发送"00000"
到1700的话就会把移动QQ和QQ交友两项服务都取消掉。
Blog或Weblog,中文称网志或部落格,或者称为博客,是一种網上一個共享空間,以日记的形式在网络上发表自己的个人内容的一种形式。

Blog历史
Blog一字本起源于 weblog,意思是网上日志。1997年由 Jorn Barger所提出。在1998年, infosift 的编辑,将一些类似blog的网站收集起来,寄给Cameron Barret。 Cameron随后将名单发布在Cambworld上,许多人亦陆续将blog的url给Cameron,慢慢的,一个新的网络社区俨然成型。1999年,Brigitte Eaton成立一个weblog目录,收集她所知道的blog站。但是,blog 真正开始快速发展的转折点,是在1999年6月,当时pitas开始提供免费的weblog服务,紧接着8月,pyra lab推出了现在的blogger.com。blogger.com 提供了简单易学的说明,以及能通过FTP直接将blog发表在个人网站上的功能,这带给使用者很大的方便。目前已经有了很多Blog托管服务商(BSP),业内人士对其盈利前景,持谨慎乐观态度。

Blog的特点
Blog是个人以时间顺序所作的一种记录。blog之间的交流主要是通过回溯引用(Trackback)和回响/留言/评论(comment)的方式来进行的。blog的操作管理用语,也借鉴了大量档案管理用语。一个blog亦可被视为一个档案(archives),或是卷宗(fonds)。与传统档案不同的是,blog的写作者,既是这份档案的创作人(creator),也是其档案管理人(archivist)。

Blog大量采用了RSS(Really Simple Syndication或者Rich Site Summary或者RDF Site Summary)技术,所有的RSS文件都必须符合由W3C发布的XML 1.0规范。对读者来说,可以通过RSS订阅一个blog,确知该blog作者最近的更新。对Blog作者来说,RSS可以使自己发布的文章易于被计算机程序理解并摘要。

对知识管理和创造而言,blog提供了新的形态和途径。 对汉语为母语的人而言,blog写作既接续了汉语笔记文学的优秀传统,更充分鼓励了个人表达。 从交往形态考察,网志空间(blogosphere)设定了积极的读者、作者、编者互动转换关系,"言者互重,阅者相惜" (http://www.blogbus.com/blogbus/blog/diary.php?diar...

在blog上经常用到的技术
RSS
ATOM
BlogML
ThreadML
Trackback
PingBack
FOAF
XML
语义网
REST
SOAP
LINGAN

在blog上经常用到的版权协议
创作共用

blog的应用
目前Blog最多用于个人出版,也有用于商业公司的内部交流和教育学习领域。另外,许多新的应用也相继出现。例如Moblog(通过移动通信设备写blog)。

参考文献
Rebecca,weblogs: a history and perspective, http://www.rebeccablood.net/essays/weblog_history.... 7 september 2000



再次整理了一下主流 Blog 程序
几个月没关心blog了,blog程序局势发生了很大的变化,尤其在国内,在原有的那些程序功能越来越强大的同时,还出现了很多不错的blog,但国外没出几个好的,MT还居于霸主地位,也许在未来几年内MT的地位是不会动摇的,国内ASP的L-blog已经成为主流,php里,多用户的Plog发展最快,其他功能都差不多,用的人比较多的是wordpress,exBlogMix,bo-blog,另外几个国产blog发展也很快。具体的功能区别我也说不上来了,大家一个一个去研究吧。

我选用blog的最基本要求就是:免费,这个最重要,呵呵;完美支持中文,包括显示和搜索;支持分类;可以发表评论,但最好有评论审核功能;支持RSS,z在我看来,不支持rss只能叫做日记本,不能称作blog;支持TrackBack,方便被人引用;有WYSIWYG编辑器;可以上传文件;模板最好和程序分离,方便修改;可以发草稿,方便以后修改。我收集的这些都具备了blog的基本功能,国外blog程序现在有上百个,但真正好用的不多。

现在很多人在找多用户blog,我列出的大部分都说自己支持多用户,但实际上多用户有两种,一种是多人共同维护一个blog,另一种是每个人有独立的blog,更多的人需要后一种,asp里的oblog和missblog,php里的Plog,asp.net里的Dottext,这几个比较好用。

下载地址我没有列出,都可以在官方网站下载。

ASP
L-Blog: http://www.loveyuki.com 由Loveyuki自主开发的基于 ASP+Access 的小型单用户BLOG,作者比较勤奋,更新很快,现在还有很多L-blog的修改版提供,模板有的非常漂亮。

Dlog: http://webdream.duoluo.com/ 国人开发比较早的一个blog了,最新版是V2.2 ,现在已经停止了开发,但已经是一个完善的程序了!

Misslog: http://www.misslog.com/blog 多用户blog,每个blog可以有多个用户参与创作与维护!

theAnswer: http://bravetime.com/dev/ 程序和界面都非常规范,现在已经是sourceforge的一个开源项目了

oblog: http://www.oioj.net 是多用户版本的Blog,实现了Blog的大部分功能,发展很快,现在已经出了SQL商业版本了。

blogx: http://www.blanksoft.com/blogx/

天畅博客: http://www.skycx.com/blog/ 非常简单小巧,但不支持RSS

另外几个国外比较看得上眼的:
dblog: http://www.dblog.it/dblog/
BP Blog: http://www.betaparticle.com/blog/
Matthew1471's BlogX: http://blogx.co.uk/Main.asp

ASP.NET

DotText: http://scottwater.com/Dottext/default.aspx 非常强大的多用户blog,国内很多大型网站在用,但安装调试非常复杂,有很多汉化版下载。

BlogX: http://www.simplegeek.com/CategoryView.aspx/BlogX 这里有一个blogx的中文修改版 http://www.blanksoft.com/blogx.asp

dasBlog: http://www.dasblog.net 新出来的程序,功能也比较齐全

PHP

b2: http://www.cafelog.com php blog的老祖宗,操作简单,容易上手,现在好像停止了开发。

b2evolution: http://www.b2evolution.net B2多用户版,有很多风格和插件。

wordpress: http://www.wordpress.org 在B2的基础上开发的,添加了很多功能,国内用户很多,。

pivot: http://www.pivotlog.net PHP+XML,没有使用数据库,有中文语言包,

nucleus: http://www.nucleuscms.org 这个也是比较老牌的程序了,有中文语言包!

exBlogMix: http://exblog.fengling.net 功能很强大的blog,更新很快,推荐使用。

M-logger: http://miracle.shakeme.net 文本储存数据。

bo-blog: http://www.bo-blog.com/ 文本数据库,现在发展的很快。

drupal: http://www.drupal.org 著名的开源程序,功能非常强大,多用户,有多种插件和皮肤下载!

O-BLOG: http://her.com.ru/ 需在PHP+MYSQL环境下运行,采用 SMARTY 模板,HTMLAREA编辑器

R-Blog: http://rays.512j.com/ 采用PHPLIB模版引擎,程序与美工基本分离,改版比较方便

boeiblog: http://myblog.boei.cn 新出来的blog程序,简单易用,模板很多。

SaBlog: http://www.4ngel.net/project/sablog.htm 安全天使小组开发的一个简单易用的blog,支持模板

Pmschine: http://www.pmachine.com 这个估计是blog的元老了,不过现在已经商业化了,新版本名叫Expression Engine,在国内可以免费下载!

bBlog: http://dev.bblog.com/ 一个非常简洁好用的blog,汉化版: http://www.xptop.com/lei/

serendipity: http://www.s9y.org 功能很多,每个功能以模块方式安装,界面也很容易修改。

bMachine: http://boastology.com 同时支持文本数据库和MySQL数据库,支持中文搜索。

Plog http://www.plogworld.org/ php blog里的最好作品了,真正的多用户,博客中国,blogit都是用这个改的。

Plainslash: http://www.51zhao.com/plainslash/ 文本blog程序,作者很久没更新了,但现在blog的基本功能都有了。

Simple Blog : http://www.bigevilbrain.com/sphpblog 国外的一个文本的小型blog,代码和界面都很简洁。

Simple Blog : http://www.tattertools.com 韩国人开发的 Blog,界面美观,功能很全。汉化中文站:http://e345.com.ru

myphpblog: http://www.myphpblog.org/

sunlog: http://www.sunlog.org

RCBlog: http://rcsoft.co.nr/

Twoblog: http://www.twoblog.com/


CGI

MT: http://www.movabletype.org 就是我现在用的,世界上用户最多的blog程序,自动生成html!后缀可以自己设置,支持文本数据库和mysql,mssql等!

Greymatter: http://www.noahgrey.com/greysoft/ 是一个类似 Movable Type 的Blog程序非常简单,也是生成静态文件。

HUS Reviv: http://supermanc.51.net/norman/blog.cgi 国人开发的,功能很强大,但由于cgi语言的问题,安装调试比较复杂,而且很占资源。

Blosxom: http://www.blosxom.com 很老的一个程序了,也可能是世界上最小的blog系统了,只有一个文件却实现了blog的大部分功能!

JSP:

DLOG4J: http://dlog4j.sourceforge.net/ 国人开发的,已经申报SourceForge项目 中文官方站: http://www.javayou.com

TM: http://www.terac.com朋友andy开发的一个功能强大的blog,支持文件上传、RSS、评论、WYSIWYG 编辑器等功能,多种语言(含简体中文)

TM: http://snipsnap.org/space/startwiki和blog结合的东东,开源项目,支持多国语言。


 最近有越来越的朋友们前来申请连接, 很高兴与朋友交流与合作. 这也可以看出网络普及化已经不可逆转了.
另外考虑到对已连接的朋友的影响问题, 不可能无限制增加没有特色的站点连接. 所以还请朋友们在建设好站点后提出. 另外请你准备好连接后,我们将考虑添加连接.

真的高兴看到每个站点有自己的特色和彼此友好交流分享.

关于我的站点名字,我一直没有对目前这个站点确定最终的名字,但是这个名称Liuxyon International 已经被使用了10年多. 所以还请你们最好先以此作为我的站点名字添加. 我一直支持国际化交流. 所以那将是我的发展趋势.
虽然我现在的站点简陋些. :-)  sunny
 

smile              coolsmile  
商务谈判中的四种探测技巧

在商务谈判中,对方的底价、时限、权限及最基本的交易条件等内容,均属机密。 谁掌握了对方的这些底牌,谁就会赢得谈判的主动。因此,在谈判初期,双方都会 围绕这些内容施展各自的探测技巧,下面就有关技巧做一些介绍。□

   一、火力侦察法。

   主动抛出一些带有挑衅性的话题,刺激对方表态,然后,再根 据对方的反应,判断其虚实。比如,甲买乙卖,甲向乙提出了几种不同的交易品种 ,并询问这些品种各自的价格。乙一时搞不清楚对方的真实意图,甲这样问,既像 是打听行情,又像是在谈交易条件;既像是个大买主,又不敢肯定。面对甲的期待 ,乙心里很矛盾,如果据实回答,万一对方果真是来摸自己底的,那自己岂不被 动?但是自己如果敷衍应付,有可能会错过一笔好的买卖,说不定对方还可能是位 可以长期合作的伙伴呢。在情急之中,乙想:我何不探探对方的虚实呢?于是,他急 中生智地说:“我是货真价实,就怕你一味贪图便宜。”我们知道,商界中奉行 着这样的准则:“一分钱一分货”、“便宜无好货”。乙的回答,暗含着对甲的挑 衅意味。除此而外,这个回答的妙处还在于,只要甲一接话,乙就会很容易地把握 甲的实力情况,如果甲在乎货的质量,就不怕出高价,回答时的口气也就大;如果 甲在乎货源的紧俏,就急于成交,口气也就显得较为迫切。在此基础上,乙就会很 容易确定出自己的方案和策略了。

  二、迂回询问法。

   通过迂回,使对方松懈,然后乘其不备,巧妙探得对方的底牌。 在主客场谈判中,东道主往往利用自己在主场的优势,实施这种技巧。东道方为了 探得对方的时限,就极力表现出自己的热情好客,除了将对方的生活做周到的安排 外,还盛情地邀请客人参观本地的山水风光,领略风土人情、民俗文化,往往会在 客人感到十分惬意之时,就会有人提出帮你订购返程机票或车船票。这时客方 往往会随口就将自己的返程日期告诉对方,在不知不觉中落入了对方的圈套里。至 于对方的时限,他却一无所知,这样,在正式的谈判中,自己受制于他人也就不足 为怪了。□

   三、聚焦深入法。

   先是就某方面的问题做扫描的提问,在探知对方的隐情所在之后 ,然后再进行深入,从而把握问题的症结所在。例如,一笔交易(甲卖乙买)双方 谈得都比较满意,但乙还是迟迟不肯签约,甲感到不解,于是他就采用这种方法达 到了目的。首先,甲证实了乙的购买意图。在此基础上,甲分别就对方对自己的信 誉、对甲本人、对甲的产品质量、包装装潢、交货期、适销期等逐项进行探问,乙 的回答表明,上述方面都不存在问题。最后,甲又问到货款的支付方面,乙表示目 前的贷款利率较高。甲得知对方这一症结所在之后,随即又进行深入,他从当前市 场的销势分析,指出乙照目前的进价成本,在市场上销售,即使扣除贷款利率,也 还有较大的利润。这一分析得到了乙的肯定,但是乙又担心,销售期太长,利息负 担可能过重,这将会影响最终的利润。针对乙的这点隐忧,甲又从风险的大小方面 进行分析,指出即使那样,风险依然很小,最终促成了签约。

  四、示错印证法。

   探测方有意通过犯一些错误,比如念错 字、用错词语,或把价格报 错等种种示错的方法,诱导对方表态,然后探测方再借题发挥,最后达到目的。例 如,在某时装区,当某一位顾客在摊前驻足,并对某件商品多看上几眼时,早已将 这一切看在眼里的摊主就会前来搭话说:“看得出你是诚心来买的,这件衣服很合 你的意,是不是?”察觉到顾客无任何反对意见时,他又会继续说:“这衣服标价150元,对你优惠,120元,要不要?”如果对方没有表态,他可能又说:“你今天身上带的钱可能不多,我 也想开个张,打本卖给你,100元,怎么样?”顾客此时会有些犹豫,摊主又会 接着说:“好啦,你不要对别人说,我就以120元卖给你。”早已留心的顾客往 往会迫不及待地说:“你刚才不是说卖100元吗?怎么又涨了?”此时,摊主 通常会煞有介事地说:“是吗?我刚才说了这个价吗?啊,这个价我可没什么赚啦 。”稍做停顿,又说,“好吧,就算是我错了,那我也讲个信用,除了你以外,不会再有这个价了,你也不要告诉别人,100元,你拿去好了!”话说到此,绝大 多数顾客都会成交。这里,摊主假装口误将价涨了上去,诱使顾客做出反应,巧妙 地探测并验证了顾客的购买需求,收到引蛇出洞的效果。在此之后,摊主再将涨上来的价让出去,就会很容易地促成交易。
[center]一个MM追GG的全过程(真实)[/center]
(转)

偶寝室一MM上网认识了同学校内研究生院的一GG(以下称为A),在聊了许久后,决定要见
面.MM拉上我们寝室几个姐妹一同前往,A也拉上他们寝室共同赴阵.
 见面挺自然的,大家都像已经很熟的朋友一样交谈着.回到寝室后,我们那位可爱的MM说
看上了他们寝室的另外一个GG(称B).我们在对其进行劝阻失败后,决定,助MM一臂之力.
 星期三有场晚会,我们班有发票子.于是我们从别的同学那里搜刮到4张多的票票.然后
MM发消息给A,说自己这里多出4张票,叫他和他寝室的几位GG一同前往.对了,忘说了,我们在
票上是花了点心思的.一共八张票,有六张分别是6排的35,33,31,29,27,25,还有两张是6排
的12,14.当晚,我们八人到音乐厅门口,MM说想去WC,然后让B帮她把包包拿着.我们三个说,
这样吧,你在这里等一下她,我们先进去了.于是就把6排12,14座的两张票给B,我们六个就先
进去了.
 晚会一结束,我们三个就催着另外三个GG从左边出口走,他们俩从右边出口走.我们等了
一会,说,他们可能先走了吧,自己先回去好了.于是我们就回到寝室.B自然就有责任把MM安
全送到寝室了.
 MM不负众望,问到了B的QQ号码~也得知了B没有女朋友.第一战略大成功~
 MMBG我们一顿午饭~


 我们第二步计划是在神不知,鬼不觉的情况下,查到B的手机号码.于是MM先在QQ上问清
楚B今天什么时间有课.趁他出门,我们就往他们寝室打电话.我们叫了隔壁一神秘女子给他
们打的电话,以免他们听出来.
 神秘女子:B在吗?
 答:不在,上课去了
 神秘女子:啊!?(语气焦急)那他手机号码多少?我找他有急事啊!
 答:哦,你等等啊......13XXXXXXXXX
 神秘女子:谢谢啊,谢谢啊,再见
 答:不用,再见
成功!
 MM再次BG我们~
 MM有了手机号码后,就给B的手机发消息,说是要借本书.B问道,你怎么知道我手机号码
?MM答曰:我只是看你的手机跟QQ绑定,上面有显示啊.B大惊:啊!不是吧,我没绑定啊!MM答:
肯定是无意中绑了的,我也是这样,随便发个消息就绑定了.这样要扣钱的,哎~现在这些公司
为了赚钱真黑啊!......
 可怜B不知道,就算绑定了也不会显示号码的~(好笨的男人)

 之后经我们调查,B要在学校运动会上参加三级跳远,而同个时间会举行女子1500米.于
是被称为全寝室运动神经最发达的笔者被迫参加女子1500(哭~~~)MMBG了笔者N个雪糕~
 当天,MM伙同寝室另外两人到场给偶加油,在跳远的地方"偶遇"到B(感觉真不厚道).B就
要开始比赛了,他把外套脱下放在地上,MM说:"我来拿吧,反正我还帮木头(笔者)拿,我今天
就当你们后勤部长好了."
 趁B在比赛,MM偷偷溜回寝室.
 当晚,MM给B打电话,内容如下.
 "对不起啊,我跑去给木头加油,她一跑完我就陪着她一起走了,忘了你的衣服还在我这
里呢~我现在给你送过去吧,你去楼下等我啊."
 B自然要绅士一点,说"不了,我到你们楼下来拿吧."
 ......
 当晚,MM很晚才回来,严刑逼供下她才招出.
 MM下楼把衣服给B后,说:真不好意思啊.
 B说:没有没有,我还要谢谢你才是呢.
 MM说,你快回去吧,肯定很累了,我还没吃饭,我现在出去买点东西吃.
 B说:这样啊,那我请你吃饭好了~当是谢谢你了
 于是......他们俩就去吃饭了......
 

 差不多就是这样了,此后,他们俩就发展得很自然了.现在甜蜜啊~`````

envy

MySQL 4.1出现Client does not support authentication protocol问题的解决办法

个人原创 转载请注明17133983原创 我的QQ:17133983

由于MySQL 4.1版本开始密码的hash算法改变,所以连接数据库时可能会出现Client does not support authentication protocol问题。

解决办法1:
进入你的MySQL目录的bin目录下
运行
MySQL --user=root --pass==root的密码
mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('连接用户的密码')
-> WHERE User = '要连接的用户名';
mysql> FLUSH PRIVILEGES;

解决办法2:
更新PHP里MySQL模块的版本以支持新版本的MySQL


他也不是什么原创,只是翻译了下官方资料. 呵呵... 不过支持啊!

A.2.3 Client does not support authentication protocol

http://dev.mysql.com/doc/mysql/en/Old_client.html

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> mysql
Client does not support authentication protocol requested
by server; consider upgrading MySQL client

To solve this problem, you should use one of the following approaches:

  • Upgrade all client programs to use a 4.1.1 or newer client library.
  • When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.
  • Reset 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.
  • Tell the server to use the older password hashing algorithm:
    1. Start mysqld with the --old-passwords option.
    2. Assign 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 the OLD_PASSWORD() function and either SET PASSWORD or UPDATE, as described earlier.

For additional background on password hashing and authentication, see section 5.5.9 Password Hashing in MySQL 4.1.

5.5.9 Password Hashing in MySQL 4.1

http://dev.mysql.com/doc/mysql/en/Password_hashing...

MySQL user accounts are listed in the user table of the mysql database. Each MySQL account is assigned a password, although what is stored in the Password column of the user table is not the plaintext version of the password, but a hash value computed from it. Password hash values are computed by the PASSWORD() function.

MySQL uses passwords in two phases of client/server communication:

  • When a client attempts to connect to the server, there is an initial authentication step in which the client must present a password that has a hash value matching the hash value stored in the user table for the account that the client wants to use.
  • After the client connects, it can (if it has sufficient privileges) set or change the password hashes for accounts listed in the user table. The client can do this by using the PASSWORD() function to generate a password hash, or by using the GRANT or SET PASSWORD statements.

In other words, the server uses hash values during authentication when a client first attempts to connect. The server generates hash values if a connected client invokes the PASSWORD() function or uses a GRANT or SET PASSWORD statement to set or change a password.

The password hashing mechanism was updated in MySQL 4.1 to provide better security and to reduce the risk of passwords being intercepted. However, this new mechanism is understood only by the 4.1 server and 4.1 clients, which can result in some compatibility problems. A 4.1 client can connect to a pre-4.1 server, because the client understands both the old and new password hashing mechanisms. However, a pre-4.1 client that attempts to connect to a 4.1 server may run into difficulties. For example, a 4.0 mysql client that attempts to connect to a 4.1 server may fail with the following error message:

shell> mysql -h localhost -u root
Client does not support authentication protocol requested
by server; consider upgrading MySQL client

The following discussion describes the differences between the old and new password mechanisms, and what you should do if you upgrade your server to 4.1 but need to maintain backward compatibility with pre-4.1 clients. Additional information can be found in section A.2.3 Client does not support authentication protocol.

Note: This discussion contrasts 4.1 behavior with pre-4.1 behavior, but the 4.1 behavior described here actually begins with 4.1.1. MySQL 4.1.0 is an ``odd'' release because it has a slightly different mechanism than that implemented in 4.1.1 and up. Differences between 4.1.0 and more recent versions are described further in section 5.5.9.2 Password Hashing in MySQL 4.1.0.

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')                            |
+-----------------------------------------------+
| *43c8aa34cdc98eddd3de1fe9a9c2c2a9f92bb2098d75 |
+-----------------------------------------------+

Accordingly, the Password column in the user table also must be 41 bytes long to store these values:

  • If you perform a new installation of MySQL 4.1, the Password column will be made 41 bytes long automatically.
  • If you upgrade an older installation to 4.1, you should run the mysql_fix_privilege_tables script to increase the length of the Password column from 16 to 41 bytes. (The script does not change existing password values, which remain 16 bytes long.)

A widened Password column can store password hashes in both the old and new formats. The format of any given password hash value can be determined two ways:

  • The obvious difference is the length (16 bytes versus 41 bytes).
  • A second difference is that password hashes in the new format always begin with a `*' character, whereas passwords in the old format never do.

The longer password hash format has better cryptographic properties, and client authentication based on long hashes is more secure than that based on the older short hashes.

The differences between short and long password hashes are relevant both for how the server uses passwords during authentication and for how it generates password hashes for connected clients that perform password-changing operations.

The way in which the server uses password hashes during authentication is affected by the width of the Password column:

  • If the column is short, only short-hash authentication is used.
  • If the column is long, it can hold either short or long hashes, and the server can use either format:
    • Pre-4.1 clients can connect, although because they know only about the old hashing mechanism, they can authenticate only for accounts that have short hashes.
    • 4.1 clients can authenticate for accounts that have short or long hashes.

For short-hash accounts, the authentication process is actually a bit more secure for 4.1 clients than for older clients. In terms of security, the gradient from least to most secure is:

  • Pre-4.1 client authenticating for account with short password hash
  • 4.1 client authenticating for account with short password hash
  • 4.1 client authenticating for account with long password hash

The way in which the server generates password hashes for connected clients is affected by the width of the Password column and by the --old-passwords option. A 4.1 server generates long hashes only if certain conditions are met: The Password column must be wide enough to hold long values and the --old-passwords option must not be given. These conditions apply as follows:

  • The Password column must be wide enough to hold long hashes (41 bytes). If the column has not been updated and still has the pre-4.1 width of 16 bytes, the server notices that long hashes cannot fit into it and generates only short hashes when a client performs password-changing operations using PASSWORD(), GRANT, or SET PASSWORD. This is the behavior that occurs if you have upgraded to 4.1 but have not yet run the mysql_fix_privilege_tables script to widen the Password column.
  • If the Password column is wide, it can store either short or long password hashes. In this case, PASSWORD(), GRANT, and SET PASSWORD generate long hashes unless the server was started with the --old-passwords option. That option forces the server to generate short password hashes instead.

The purpose of the --old-passwords option is to allow you to maintain backward compatibility with pre-4.1 clients under circumstances where the server would otherwise generate long password hashes. The option doesn't affect authentication (4.1 clients can still use accounts that have long password hashes), but it does prevent creation of a long password hash in the user table as the result of a password-changing operation. Were that to occur, the account no longer could be used by pre-4.1 clients. Without the --old-passwords option, the following undesirable scenario is possible:

  • An old client connects to an account that has a short password hash.
  • The client changes its own password. Without --old-passwords, this results in the account having a long password hash.
  • The next time the old client attempts to connect to the account, it cannot, because the account now has a long password hash that requires the new hashing mechanism during authentication. (Once an account has a long password hash in the user table, only 4.1 clients can authenticate for it, because pre-4.1 clients do not understand long hashes.)

This scenario illustrates that, if you must support older pre-4.1 clients, it is dangerous to run a 4.1 server without using the --old-passwords option. By running the server with --old-passwords, password-changing operations will not generate long password hashes and thus do not cause accounts to become inaccessible to older clients. (Those clients cannot inadvertently lock themselves out by changing their password and ending up with a long password hash.)

The downside of the --old-passwords option is that any passwords you create or change will use short hashes, even for 4.1 clients. Thus, you lose the additional security provided by long password hashes. If you want to create an account that has a long hash (for example, for use by 4.1 clients), you must do so while running the server without --old-passwords.

The following scenarios are possible for running a 4.1 server:

Scenario 1: Short Password column in user table:

  • Only short hashes can be stored in the Password column.
  • The server uses only short hashes during client authentication.
  • For connected clients, password hash-generating operations involving PASSWORD(), GRANT, or SET PASSWORD use short hashes exclusively. Any change to an account's password results in that account having a short password hash.
  • The --old-passwords option can be used but is superfluous because with a short Password column, the server will generate only short password hashes anyway.

Scenario 2: Long Password column; server not started with --old-passwords option:

  • Short or long hashes can be stored in the Password column.
  • 4.1 clients can authenticate for accounts that have short or long hashes.
  • Pre-4.1 clients can authenticate only for accounts that have short hashes.
  • For connected clients, password hash-generating operations involving PASSWORD(), GRANT, or SET PASSWORD use long hashes exclusively. A change to an account's password results in that account having a long password hash.

As indicated earlier, a danger in this scenario is that it is possible for accounts that have a short password hash to become inaccessible to pre-4.1 clients. A change to such an account's password made via GRANT, PASSWORD(), or SET PASSWORD results in the account being given a long password hash. From that point on, no pre-4.1 client can authenticate to that account until the client upgrades to 4.1.

To deal with this problem, you can change a password in a special way. For example, normally you use SET PASSWORD as follows to change an account password:

mysql> SET PASSWORD FOR 'some_user'@'some_host' = PASSWORD('mypass');

To change the password but create a short hash, use the OLD_PASSWORD() function instead:

mysql> SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('mypass');

OLD_PASSWORD() is useful for situations in which you explicitly want to generate a short hash.

Scenario 3: Long Password column; server started with --old-passwords option:

  • Short or long hashes can be stored in the Password column.
  • 4.1 clients can authenticate for accounts that have short or long hashes (but note that it is possible to create long hashes only when the server is started without --old-passwords).
  • Pre-4.1 clients can authenticate only for accounts that have short hashes.
  • For connected clients, password hash-generating operations involving PASSWORD(), GRANT, or SET PASSWORD use short hashes exclusively. Any change to an account's password results in that account having a short password hash.

In this scenario, you cannot create accounts that have long password hashes, because the --old-passwords option prevents generation of long hashes. Also, if you create an account with a long hash before using the --old-passwords option, changing the account's password while --old-passwords is in effect results in the account being given a short password, causing it to lose the security benefits of a longer hash.

The disadvantages for these scenarios may be summarized as follows:

In scenario 1, you cannot take advantage of longer hashes that provide more secure authentication.

In scenario 2, accounts with short hashes become inaccessible to pre-4.1 clients if you change their passwords without explicitly using OLD_PASSWORD().

In scenario 3, --old-passwords prevents accounts with short hashes from becoming inaccessible, but password-changing operations cause accounts with long hashes to revert to short hashes, and you cannot change them back to long hashes while --old-passwords is in effect.

Subsections

 

5.5.9.2 Password Hashing in MySQL 4.1.0 Password hashing in MySQL 4.1.0 differs from hashing in 4.1.1 and up. The 4.1.0 differences are: Password hashes are 45 bytes long rather than 41 bytes. The PASSWORD() function is non-repeatable. That is, with a given argument X, successive calls to PASSWORD(X) generate different results. These differences make authentication in 4.1.0 incompatible with that of releases that follow it. If you have upgraded to MySQL 4.1.0, it is recommended that you upgrade to a newer version as soon as possible. After you do, reassign any long passwords in the user table so that they are compatible with the 41-byte format.

5.5.8 Causes of Access denied Errors

http://dev.mysql.com/doc/mysql/en/Access_denied.ht...

If you encounter problems when you try to connect to the MySQL server, the following items describe some courses of action you can take to correct the problem.

  • Make sure that the server is running. If it is not running, you cannot connect to it. For example, if you attempt to connect to the server and see a message such as one of those following, one cause might be that the server is not running:
    shell> mysql
    ERROR 2003: Can't connect to MySQL server on 'host_name' (111)
    shell> mysql
    ERROR 2002: Can't connect to local MySQL server through socket
    '/tmp/mysql.sock' (111)
    It might also be that the server is running, but you are trying to connect using a TCP/IP port, named pipe, or Unix socket file different from those on which the server is listening. To correct this when you invoke a client program, specify a --port option to indicate the proper port, or a --socket option to indicate the proper named pipe or Unix socket file. To find out what port is used, and where the socket is, you can do:
    shell> netstat -l | grep mysql
  • The grant tables must be properly set up so that the server can use them for access control. For some distribution types (such as binary distributions on Windows on RPM distributions on Linux), the installation process initializes the mysql database containing the grant tables. For distributions that do not do this, you should initialize the grant tables manually by running the mysql_install_db script. For details, see section 2.9.2 Unix Post-Installation Procedures. One way to determine whether you need to initialize the grant tables is to look for a `mysql' directory under the data directory. (The data directory normally is named `data' or `var' and is located under your MySQL installation directory.) Make sure that you have a file named `user.MYD' in the `mysql' database directory. If you do not, execute the mysql_install_db script. After running this script and starting the server, test the initial privileges by executing this command:
    shell> mysql -u root test
    The server should let you connect without error.
  • After a fresh installation, you should connect to the server and set up your users and their access permissions:
    shell> mysql -u root mysql
    The server should let you connect because the MySQL root user has no password initially. That is also a security risk, so setting the password for the root accounts is something you should do while you're setting up your other MySQL users. For instructions on setting the initial passwords, see section 2.9.3 Securing the Initial MySQL Accounts.
  • If you have updated an existing MySQL installation to a newer version, did you run the mysql_fix_privilege_tables script? If not, do so. The structure of the grant tables changes occasionally when new capabilities are added, so after an upgrade you should always make sure that your tables have the current structure. For instructions, see section 2.10.7 Upgrading the Grant Tables.
  • If a client program receives the following error message when it tries to connect, it means that the server expects passwords in a newer format than the client is capable of generating:
    shell> mysql
    Client does not support authentication protocol requested
    by server; consider upgrading MySQL client
    For information on how to deal with this, see section 5.5.9 Password Hashing in MySQL 4.1 and section A.2.3 Client does not support authentication protocol.
  • If you try to connect as root and get the following error, it means that you don't have an entry in the user table with a User column value of 'root' and that mysqld cannot resolve the hostname for your client:
    Access denied for user ''@'unknown' to database mysql
    In this case, you must restart the server with the --skip-grant-tables option and edit your `/etc/hosts' or `\windows\hosts' file to add an entry for your host.
  • Remember that client programs will use connection parameters specified in option files or environment variables. If a client program seems to be sending incorrect default connection parameters when you don't specify them on the command line, check your environment and any applicable option files. For example, if you get Access denied when you run a client without any options, make sure that you haven't specified an old password in any of your option files! You can suppress the use of option files by a client program by invoking it with the --no-defaults option. For example:
    shell> mysqladmin --no-defaults -u root version
    The option files that clients use are listed in section 4.3.2 Using Option Files. Environment variables are listed in section F Environment Variables.
  • If you get the following error, it means that you are using an incorrect root password:
    shell> mysqladmin -u root -pxxxx ver
    Access denied for user 'root'@'localhost' (using password: YES)
    If the preceding error occurs even when you haven't specified a password, it means that you have an incorrect password listed in some option file. Try the --no-defaults option as described in the previous item. For information on changing passwords, see section 5.6.5 Assigning Account Passwords. If you have lost or forgotten the root password, you can restart mysqld with --skip-grant-tables to change the password. See section A.4.1 How to Reset the Root Password.
  • If you change a password by using SET PASSWORD, INSERT, or UPDATE, you must encrypt the password using the PASSWORD() function. If you do not use PASSWORD() for these statements, the password will not work. For example, the following statement sets a password, but fails to encrypt it, so the user will not be able to connect afterward:
    mysql> SET PASSWORD FOR 'abe'@'host_name' = 'eagle';
    Instead, set the password like this:
    mysql> SET PASSWORD FOR 'abe'@'host_name' = PASSWORD('eagle');
    The PASSWORD() function is unnecessary when you specify a password using the GRANT statement or the mysqladmin password command, both of which automatically use PASSWORD() to encrypt the password. See section 5.6.5 Assigning Account Passwords.
  • localhost is a synonym for your local hostname, and is also the default host to which clients try to connect if you specify no host explicitly. However, connections to localhost on Unix systems do not work if you are using a MySQL version older than 3.23.27 that uses MIT-pthreads: localhost connections are made using Unix socket files, which were not supported by MIT-pthreads at that time. To avoid this problem on such systems, you can use a --host=127.0.0.1 option to name the server host explicitly. This will make a TCP/IP connection to the local mysqld server. You can also use TCP/IP by specifying a --host option that uses the actual hostname of the local host. In this case, the hostname must be specified in a user table entry on the server host, even though you are running the client program on the same host as the server.
  • If you get an Access denied error when trying to connect to the database with mysql -u user_name, you may have a problem with the user table. Check this by executing mysql -u root mysql and issuing this SQL statement:
    mysql> SELECT * FROM user;
    The result should include an entry with the Host and User columns matching your computer's hostname and your MySQL username.
  • The Access denied error message will tell you who you are trying to log in as, the client host from which you are trying to connect, and whether or not you were using a password. Normally, you should have one entry in the user table that exactly matches the hostname and username that were given in the error message. For example, if you get an error message that contains using password: NO, it means that you tried to log in without an password.
  • If the following error occurs when you try to connect from a host other than the one on which the MySQL server is running, it means that there is no row in the user table with a Host value that matches the client host:
    Host ... is not allowed to connect to this MySQL server
    You can fix this by setting up an account for the combination of client hostname and username that you are using when trying to connect. If you don't know the IP number or hostname of the machine from which you are connecting, you should put an entry with '%' as the Host column value in the user table and restart mysqld with the --log option on the server machine. After trying to connect from the client machine, the information in the MySQL log will indicate how you really did connect. (Then change the '%' in the user table entry to the actual hostname that shows up in the log. Otherwise, you'll have a system that is insecure because it allows connections from any host for the given username.) On Linux, another reason that this error might occur is that you are using a binary MySQL version that is compiled with a different version of the glibc library than the one you are using. In this case, you should either upgrade your operating system or glibc, or download a source distribution of MySQL version and compile it yourself. A source RPM is normally trivial to compile and install, so this isn't a big problem.
  • If you specify a hostname when trying to connect, but get an error message where the hostname is not shown or is an IP number, it means that the MySQL server got an error when trying to resolve the IP number of the client host to a name:
    shell> mysqladmin -u root -pxxxx -h some-hostname ver
    Access denied for user 'root'@'' (using password: YES)
    This indicates a DNS problem. To fix it, execute mysqladmin flush-hosts to reset the internal DNS hostname cache. See section 7.5.6 How MySQL Uses DNS. Some permanent solutions are:
    • Try to find out what is wrong with your DNS server and fix it.
    • Specify IP numbers rather than hostnames in the MySQL grant tables.
    • Put an entry for the client machine name in /etc/hosts.
    • Start mysqld with the --skip-name-resolve option.
    • Start mysqld with the --skip-host-cache option.
    • On Unix, if you are running the server and the client on the same machine, connect to localhost. Unix connections to localhost use a Unix socket file rather than TCP/IP.
    • On Windows, if you are running the server and the client on the same machine and the server supports named pipe connections, connect to the hostname . (period). Connections to . use a named pipe rather than TCP/IP.
  • If mysql -u root test works but mysql -h your_hostname -u root test results in Access denied (where your_hostname is the actual hostname of the local host), you may not have the correct name for your host in the user table. A common problem here is that the Host value in the user table entry specifies an unqualified hostname, but your system's name resolution routines return a fully qualified domain name (or vice versa). For example, if you have an entry with host 'tcx' in the user table, but your DNS tells MySQL that your hostname is 'tcx.subnet.se', the entry will not work. Try adding an entry to the user table that contains the IP number of your host as the Host column value. (Alternatively, you could add an entry to the user table with a Host value that contains a wildcard; for example, 'tcx.%'. However, use of hostnames ending with `%' is insecure and is not recommended!)
  • If mysql -u user_name test works but mysql -u user_name other_db_name does not, you have not granted database access for other_db_name to the given user.
  • If mysql -u user_name works when executed on the server host, but mysql -h host_name -u user_name doesn't work when executed on a remote client host, you have not enabled access to the server for the given username from the remote host.
  • If you can't figure out why you get Access denied, remove from the user table all entries that have Host values containing wildcards (entries that contain `%' or `_'). A very common error is to insert a new entry with Host='%' and User='some_user', thinking that this will allow you to specify localhost to connect from the same machine. The reason that this doesn't work is that the default privileges include an entry with Host='localhost' and User=''. Because that entry has a Host value 'localhost' that is more specific than '%', it is used in preference to the new entry when connecting from localhost! The correct procedure is to insert a second entry with Host='localhost' and User='some_user', or to delete the entry with Host='localhost' and User=''. After deleting the entry, remember to issue a FLUSH PRIVILEGES statement to reload the grant tables.
  • If you get the following error, you may have a problem with the db or host table:
    Access to database denied
    If the entry selected from the db table has an empty value in the Host column, make sure that there are one or more corresponding entries in the host table specifying which hosts the db table entry applies to.
  • If you are able to connect to the MySQL server, but get an Access denied message whenever you issue a SELECT ... INTO OUTFILE or LOAD DATA INFILE statement, your entry in the user table doesn't have the FILE privilege enabled.
  • If you change the grant tables directly (for example, by using INSERT, UPDATE, or DELETE statements) and your changes seem to be ignored, remember that you must execute a FLUSH PRIVILEGES statement or a mysqladmin flush-privileges command to cause the server to re-read the privilege tables. Otherwise, your changes have no effect until the next time the server is restarted. Remember that after you change the root password with an UPDATE command, you won't need to specify the new password until after you flush the privileges, because the server won't know you've changed the password yet!
  • If your privileges seem to have changed in the middle of a session, it may be that a MySQL administrator has changed them. Reloading the grant tables affects new client connections, but it also affects existing connections as indicated in section 5.5.7 When Privilege Changes Take Effect.
  • If you have access problems with a Perl, PHP, Python, or ODBC program, try to connect to the server with mysql -u user_name db_name or mysql -u user_name -pyour_pass db_name. If you are able to connect using the mysql client, the problem lies with your program, not with the access privileges. (There is no space between -p and the password; you can also use the --password=your_pass syntax to specify the password. If you use the -p option alone, MySQL will prompt you for the password.)
  • For testing, start the mysqld server with the --skip-grant-tables option. Then you can change the MySQL grant tables and use the mysqlaccess script to check whether your modifications have the desired effect. When you are satisfied with your changes, execute mysqladmin flush-privileges to tell the mysqld server to start using the new grant tables. (Reloading the grant tables overrides the --skip-grant-tables option. This allows you to tell the server to begin using the grant tables again without stopping and restarting it.)
  • If everything else fails, start the mysqld server with a debugging option (for example, --debug=d,general,query). This will print host and user information about attempted connections, as well as information about each command issued. See section E.1.2 Creating Trace Files.
  • If you have any other problems with the MySQL grant tables and feel you must post the problem to the mailing list, always provide a dump of the MySQL grant tables. You can dump the tables with the mysqldump mysql command. As always, post your problem using the mysqlbug script. See section 1.4.1.3 How to Report Bugs or Problems. In some cases, you may need to restart mysqld with --skip-grant-tables to run mysqldump.


User Comments

Posted by Andrew Eigus on May 2 2003 4:19am[Delete] [Edit]

essential information for Microsoft Access MySQL users:

sometimes, when you use Microsoft Access to update tables, you get unexpected "access denied for user: '@YOUR_IP_ADDRESS'" errors, which is to be solved in the following way:

Microsoft Access 2000/2002 Jet/ODBC database engine uses default anonymous logins by default, and you should tweak the following registry key so that the ODBC DSN's options were used, instead:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\ODBC]
"TryJetAuth"=dword:00000000

hope this helps,

Andrew Eigus
Astros Information Technologies - Riga

Posted by [name withheld] on May 4 2003 8:19am[Delete] [Edit]

I have a small network in my home. My RH8.something server has DHCP and DNS for my small domain (.home.tesmer.org). I do not have DNS names for the hosts on DHCP.

When trying to run MySQLCC in WinXP on a DHCP'd host, I continually got "[gummy] ERROR 2013: Lost connection to MySQL server during query" (gummy is the dns name of the host running the MySQL instance).

I added skip-name-resolve under [mysqld] in my.cnf and restarted the mysqld using the init script, and viola, it worked.

Posted by [name withheld] on July 31 2003 3:58am[Delete] [Edit]

when you are simply trying to:
C:\mysql\bin>mysql -uroot -p mysql

and you get:

ERROR 1044: Access denied for user: '@127.0.0.1' to database 'mysql'

Here is what I do. The key is to supply your real ip address for the -h (host) parameter. On windows, from the command prompt type 'ipconfig' to see your ip address. Once you have that, do the following:

C:\mysql\bin>mysql -h 192.168.0.1 -u root -p mysql
Enter password: ****************

// then I explicitly add root@127.0.0.1 to the user table, so after this I can log in as you would expect

GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY 'root-password' WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON *.* TO root@127.0.0.1 IDENTIFIED BY 'root-password' WITH GRANT OPTION;

// delete anon accounts

DELETE FROM mysql.user WHERE password='';

FLUSH PRIVILEGES;

It works for me

One other way is when you set the initial password for the root user, also set it on 127.0.0.1:

SET PASSWORD FOR root@localhost=PASSWORD('new_password');
SET PASSWORD FOR root@127.0.0.1=PASSWORD('root-password');
FLUSH PRIVILEGES;

Posted by David Morris on December 13 2003 11:16am[Delete] [Edit]

+++SIMPLE CPANEL SOLUTION++++
If you get this error message
"Access denied for user: 'root@localhost' (Using password: YES)"

Then this may work for you.

When connecting to the MySQL server from a remote location You have to specify the "hosts"(remote location IP's) that you will be accessing the database from.

You must have access to CPANEL and have MySQL features enabled for this solution to work. A simple way to check if you have these features is to go into the CPANEL and look for the MySQL Databases Section.

If you have it listed, go into it.

Down towards the bottom of the page that loads you will see a heading called "Access Hosts".

By default you will only see "localhost" listed below this heading. This means only database access from the localhost(yourserver) is allowed.

You can add more hosts to this list by using the text box provided with the title "Host:"

For Example: if you wanted to give access to the MySQL server to a remote computer with this static IP address: 211.233.2.24 all you would simply do is type in the IP address in the textbox and hit the "add host" button.

If you had an entire network that you needed to give access to the MySQL server simply use the wildcard "%" symbol eg. 211.233.2.%

SECURITY WARNING: If you do not have a static IP address, using a wildcard "%" may open a security hole that can lead to unauthorized access to the MySQL server from a remote address. Make certain you delete all added hosts if you are not intending on using them and only set up wildcards if no one outside your network has access to the IP range you have specified.

Hope this helps - I know it did for me. :)


Posted by [name withheld] on February 14 2004 5:44pm[Delete] [Edit]

My local network is on DHCP with addresses assigned in the 192.168.0.100 to .199 range, so there is no guarantee what IP I will have when administering the DB. However, rather than grant privs to root@'%', I granted privs to root@'192.168.0.1%' so that it is a little more secure. Full command:
GRANT ALL PRIVILEGES ON *.* TO root@'192.168.0.1%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

Posted by [name withheld] on February 27 2004 5:54am[Delete] [Edit]


GRANT ALL PRIVILEGES ON *.* TO root@'192.168.0.1%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;


this seems to grant access to '192.168.0.10' - '192.168.0.19' as well, might wanna specify as '192.168.0.1__'(2 underscores) so that it accepts 2 (and only 2) wild characters.

Posted by [name withheld] on March 2 2004 3:19am[Delete] [Edit]

I had problems connecting to MySQL over tcp/3306
on debian stable, localhost. It was not enabling networking
in my.cnf, but it was a missing entry in /etc/hosts.allow

I added the following to /etc/hosts.allow:

mysqld 127.0.0.1

I discovered the problem when trying to connect from Java
using the latest stable J/Connector. The error given
was "Communication link failure: null" which was not so
specific.

Since Java only allows you to connect over tcp, you have
no other alternative. If you experience similar problems
from Java, please test to do the following:

telnet localhost 3306

If you are connected and immediately after that disconnected
before the mysqld answers, it might be the missing entry in
hosts.allow .

You can also see if your tcp connection works by forcing
the mysql client to connect over tcp/3306:

mysql -u root -h 127.0.0.1 -P 3306 -p

The error given if you have a network problem, is:
ERROR 2013: Lost connection to MySQL server during query

If you run into this, using debian, then my advice is
to add a line accordingly to /etc/hosts.allow

The reason for this happening on debian, is that
the apt-get package for mysql-server is compiled
with tcp-wrapper support. This is not mentioned
in the file README.debian, so it may come as a surprise
to you. It did to me, to say the least.
Rikard

Posted by April S- on July 24 2004 10:33am[Delete] [Edit]

I spent DAYS trying to track this problem down! :-)

Anyway, with a fresh install I was trying to connect to MySQL from a remote server - but I was getting messages that it could not connect.

I made sure I had users with correct priveleges, made sure mysqld was running on and listening to port 3306..... and it was ALL because of one line in my my.cnf file!!

bind-address=127.0.0.1

I removed that line - restarted mysql and now I have no problem connecting to MySQL from anywhere but localhost!

Perhaps "bind-address" should be listed as one of the potential causes. ;-)

Posted by [name withheld] on August 10 2004 7:27pm[Delete] [Edit]

The "2003 CR_CONN_HOST_ERROR" seems to occur while rapidly opening and closing connections across a network...so keep the connection open.

Posted by Ronald on September 28 2004 5:17pm[Delete] [Edit]

Essential information for Microsoft Access MySQL users:

sometimes, when you use Microsoft Access to update tables, you get unexpected "access denied for user: '@YOUR_IP_ADDRESS'" errors, which is to be solved in the following way:

Microsoft Access 2000/2002 Jet/ODBC database engine uses default anonymous logins by default, and you should tweak the following registry key so that the ODBC DSN's options were used, instead:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\ODBC]
"TryJetAuth"=dword:00000000

hope this helps,

Ronald

Posted by Dagon Midgard on September 28 2004 9:40pm[Delete] [Edit]

For
ERROR 2003: Can't connect to MySQL server on '127.0.0.1' (111)

and no entries in the error.log or mysql.log

If it's not bind-address then it's probably skip-networking. Turn that off and it worked for me running debian - the /etc/hosts.allow option didn't help me with that on!

Posted by Ronald on October 11 2004 3:21pm[Delete] [Edit]

Essential information for Microsoft Access MySQL users:

sometimes, when you use Microsoft Access to update tables, you get unexpected "access denied for user: '@YOUR_IP_ADDRESS'" errors, which is to be solved in the following way:

Microsoft Access 2000/2002 Jet/ODBC database engine uses default anonymous logins by default, and you should tweak the following registry key so that the ODBC DSN's options were used, instead:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\ODBC]
"TryJetAuth"=dword:00000000

hope this helps,

Ronald

Posted by israel olalla on October 20 2004 10:54pm[Delete] [Edit]

Hi.

If your have problems conneecting to your mysql server in a debian installation the problem can be that the networking is disabled for security reasons.

I detected the problem cause i was unable to connect using jdbc to my local mysql server, i had always a java.net.ConnectException MESSAGE: Connection refused.

To solve it you should comment the line containing skip-networking:
#skip-networking
After doing this you should reboot the mysql server with:
/etc/init.d/mysql restart
And voila everything will work fine.

Hope this helps

Posted by Dan Williams on October 24 2004 3:58am[Delete] [Edit]

I was setting up MySQL from the instructions from the O'Reilly PHP and MySQL book and encountered "ERROR 1045: Access denied for user: 'username@localhost' (Using password: YES)". Well the instruction said to add the 'username' with the SQL statement as:

GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON winestores.* TO username@127.0.0.1 IDENTIFIED by 'password';

After doing this as root, I quit and tried to log back in with the new user. I got the ERROR 1045.

I fixed it by logging back in as root and reissuing the SQL statement again except with 'username@localhost'. It worked!

I don't know why? Maybe it is the difference between IPs of '127.0.0.1' and 'localhost'???

Hope this helps!

Add your own comment.

【1、最基本的弹出窗口代码】
  
  <SCRIPT LANGUAGE="javascript">
  <!--
  window.open ('page.html')
  -->
  </SCRIPT>
  
  因为着是一段javascripts代码,所以它们应该放在<SCRIPT LANGUAGE="javascript">标签和</script>之间。<!-- 和 -->是对一些版本低的浏览器起作用,在这些老浏览器中不会将标签中的代码作为文本显示出来。要养成这个好习惯啊。window.open ('page.html') 用于控制弹出新的窗口page.html,如果page.html不与主窗口在同一路径下,前面应写明路径,绝对路径(http://)和相对路径(../)均可。用单引号和双引号都可以,只是不要混用。这一段代码可以加入HTML的任意位置,<head>和</head>之间可以,<body>间</body>也可以,越前越早执行,尤其是页面代码长,又想使页面早点弹出就尽量往前放。
   
  【2、经过设置后的弹出窗口】
  
  下面再说一说弹出窗口的设置。只要再往上面的代码中加一点东西就可以了。 我们来定制这个弹出的窗口的外观,尺寸大小,弹出的位置以适应该页面的具体情况。
  
  <SCRIPT LANGUAGE="javascript">
  <!--
  window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no') //这句要写成一行
  -->
  </SCRIPT>  
  
  参数解释:
  
  <SCRIPT LANGUAGE="javascript"> js脚本开始;
  window.open 弹出新窗口的命令;
  'page.html' 弹出窗口的文件名;
  'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替;
  height=100 窗口高度;
  width=400 窗口宽度;
  top=0 窗口距离屏幕上方的象素值;
  left=0 窗口距离屏幕左侧的象素值;
  toolbar=no 是否显示工具栏,yes为显示;
  menubar,scrollbars 表示菜单栏和滚动栏。
  resizable=no 是否允许改变窗口大小,yes为允许;
  location=no 是否显示地址栏,yes为允许;
  status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许;
  </SCRIPT> js脚本结束

    
  【3、用函数控制弹出窗口】
  
  下面是一个完整的代码。
  <html>
  <head>
  <script LANGUAGE="JavaScript">
  <!--
  function openwin() {
  window.open ("page.html", "newwindow", "height=100, width=400, toolbar =no, menubar=no, scrollbars=no, resizable=no, location=no, status=no") //写成一行
   }
  //-->
  </script>
  </head>
  <body onload="openwin()">
  任意的页面内容...
  </body>
  </html>

  这里定义了一个函数openwin(),函数内容就是打开一个窗口。在调用它之前没有任何用途。怎么调用呢?

  方法一:<body onload="openwin()"> 浏览器读页面时弹出窗口;
  方法二:<body onunload="openwin()"> 浏览器离开页面时弹出窗口;
  方法三:用一个连接调用:
  <a href="#" onclick="openwin()">打开一个窗口</a>
  注意:使用的“#”是虚连接。
  方法四:用一个按钮调用:
  <input type="button" onclick="openwin()" value="打开窗口">

 
   
  【4、同时弹出2个窗口】
  
   对源代码稍微改动一下:
  
  <script LANGUAGE="JavaScript">
  <!--
  function openwin() {
  window.open ("page.html", "newwindow", "height=100, width=100, top=0, left=0,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=n o, status=no")//写成一行
  window.open ("page2.html", "newwindow2", "height=100, width=100, top=1 00, left=100,toolbar=no, menubar=no, scrollbars=no, resizable=no, loca tion=no, status=no")//写成一行
   }
  //-->
  </script>
  为避免弹出的2个窗口覆盖,用top和left控制一下弹出的位置不要相互覆盖即可 。最后用上面说过的四种方法调用即可。
  注意:2个窗口的name(newwindows和newwindow2)不要相同,或者干脆全部为空。  
  
  【5、主窗口打开文件1.htm,同时弹出小窗口page.html】

  如下代码加入主窗口<head>区:
  <script language="javascript">
  <!--
  function openwin() {
  window.open("page.html","","width=200,height=200")
   }
  //-->
  </script>
  加入<body>区:
  <a href="1.htm" onclick="openwin()">open</a>即可。

  
  【6、弹出的窗口之定时关闭控制】
  
  下面我们再对弹出的窗口进行一些控制,效果就更好了。如果我们再将一小段 代码加入弹出的页面(注意是加入page.html的HTML中,可不是主页面中,否则 ...),让它10秒后自动关闭是不是更酷了?
首先,将如下代码加入page.html文件的<head>区:
  <script language="JavaScript">
  function closeit()
  {
  setTimeout("self.close()",10000) //毫秒
   }
  </script>
  然后,再用<body onload="closeit()"> 这一句话代替page.html中原有的<BODY>这一句就可以了。(这一句话千万不要忘记写啊!这一句的作用是调用关闭窗 口的代码,10秒钟后就自行关闭该窗口。)
  【7、在弹出窗口中加上一个关闭按钮】

  <FORM>
  <INPUT TYPE='BUTTON' VALUE='关闭' onClick='window.close()'>
  </FORM>
  呵呵,现在更加完美了!

  【8、内包含的弹出窗口-一个页面两个窗口】

  上面的例子都包含两个窗口,一个是主窗口,另一个是弹出的小窗口。通过下面的例子,你可以在一个页面内完成上面的效果。


  <html>
  <head>
  <SCRIPT LANGUAGE="JavaScript">
  function openwin()
  {
  OpenWindow=window.open("", "newwin", "height=250, width=250,toolbar=no ,scrollbars="+scroll+",menubar=no");
  //写成一行
  OpenWindow.document.write("<TITLE>例子</TITLE>")
  OpenWindow.document.write("<BODY BGCOLOR=#ffffff>")
  OpenWindow.document.write("<h1>Hello!</h1>")
  OpenWindow.document.write("New window opened!")
  OpenWindow.document.write("</BODY>")
  OpenWindow.document.write("</HTML>")
  OpenWindow.document.close()
   }
  </SCRIPT>
  </head>
  <body>
  <a href="#" onclick="openwin()">打开一个窗口</a>
  <input type="button" onclick="openwin()" value="打开窗口">
  </body>
  </html>

  看看OpenWindow.document.write()里面的代码不就是标准的HTML吗?只要按照 格式写更多的行即可。千万注意多一个标签或少一个标签就会出现错误。记得用 OpenWindow.document.close()结束啊。

  【9、终极应用--弹出的窗口之Cookie控制】

  回想一下,上面的弹出窗口虽然酷,但是有一点小毛病(沉浸在喜悦之中,一定 没有发现吧?)比如你将上面的脚本放在一个需要频繁经过的页面里(例如首页),那么每次刷新这个页面,窗口都会弹出一次,是不是非常烦人?:-(
  有解决的办法吗?Yes! ;-) Follow me.我们使用cookie来控制一下就可以了。
  首先,将如下代码加入主页面HTML的<HEAD>区:

  <script>
  function openwin(){
  window.open("page.html","","width=200,height=200")
   }
  function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
  offset = document.cookie.indexOf(search)
  if (offset != -1) {
  offset += search.length
  end = document.cookie.indexOf(";", offset);
  if (end == -1)
  end = document.cookie.length;
  returnvalue=unescape(document.cookie.substring(offset, end))
   }
   }
  return returnvalue;
   }  
  function loadpopup(){
  if (get_cookie('popped')==''){
  openwin()
  document.cookie="popped=yes"
   }
   }
  </script>

  然后,用<body onload="loadpopup()">(注意不是openwin而是loadpop啊!)替换主页面中原有的<BODY>这一句即可。你可以试着刷新一下这个页面或重新进 入该页面,窗口再也不会弹出了。真正的Pop-Only-Once!

最近看到更多国外的资料讨论中国以及其它一些国家的网络限制问题. 并且已经有一些国外专门研究解决网络限制的方法. 更多资料,还是自己看看吧. 也许对你也有帮助.

http://en.wikipedia.org/wiki/Internet_censorship_i...

TOOLS:

http://mdweiss.ods.org/cgi-bin/nph-pro.pl/000010A/...

http://mygod.net.ru/tool/bypass/bypass.html


----------------
The People's Republic of China has set up a system of Internet censorship in Mainland China.

One part of this system is known outside China as the Great Firewall of China (in reference both to its role as a network firewall and to the ancient Great Wall of China). The system blocks content by preventing IP addresses from being routed through and consists of standard firewall and proxy servers at the Internet gateways. The government does not appear to be systematically examining Internet content, as this appears to be technically impractical.

This firewall is largely ineffective at preventing the flow of information and is rather easily circumvented by determined parties by using proxy servers outside the firewall. For a few weeks in 2002, the Chinese government attempted to block Google, but this block was quickly removed, though some features on Google (such as Google Cache) remain erratic.


On July 11, 2003, the PRC government granted licenses to open Internet cafe chains. The licenses were awarded to 10 firms, including three affiliated to the Chinese Ministry of Culture: China Audio-Visual Publishing House, which plans to set up 50,000 cafes in 40 cities in three years, the China Cultural Relics Information Center and the China National Library. A fourth operator, China Youth Net, is affiliated with the politically powerful Central Committee of China Youth League. The other six include state-owned telecoms operators such as China United Telecommunications Corporation, parent of China Unicom Ltd, Great Wall Broadband Network Service Co Ltd, or Internet service providers such as www.readchina.com, which belongs to Read Investment Holdings Co., a high-tech conglomerate founded in 1988 which has annual revenues of 10 billion yuan. Business analysts and foreign internet operators regard the licenses as intended to clamp down on information deemed harmful to the PRC government.

On June 4, 2004, access to the Chinese Wikipedia from Beijing was blocked. This coincided with the anniversary of the Tiananmen Square protests of 1989. On May 31 an article from the IDG News Service was published [1] (http://www.pcworld.com/news/article/0,aid,116323,00.asp), discussing the Chinese Wikipedia's treatment of the protests. The Chinese Wikipedia also has articles related to Taiwanese independence, written by Taiwanese contributors [2] (http://mail.wikipedia.org/pipermail/wikipedia-l/20... and others. Several days after the anniversary, all Wikimedia sites were blocked from Mainland China. Around June 21, 2004, the blocks were lifted, following a written appeal by several mainland China contributors to relevant government agencies that administered the blocks.

On September 23, 2004, access to Wikipedia is once again unavailable to some users in mainland China

分页: 18/18 第一页 上页 14 15 16 17 18 最后页 [ 显示模式: 摘要 | 列表 ]