摘要: 一、配制my.cnf(/etc/my.cnf)slow_query_log=onlong_query_time=1slow_query_log_file=/var/log/slow_query.log二、创建日志文件touch slow_query.log chmod 777 slow_query.... 阅读全文
posted @ 2015-12-09 15:58 古月天 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 一、数据表结构CREATE TABLE `jx_attach` ( `attach_id` int(11) NOT NULL AUTO_INCREMENT, `feed_id` int(11) DEFAULT NULL , `attach_name` varchar(255) NOT NULL... 阅读全文
posted @ 2015-12-09 15:41 古月天 阅读(17368) 评论(0) 推荐(1) 编辑
摘要: 有时比如注册用户,需要检查用户名的长度,可能会用到以下两个函数来做判断strlenint strlen ( string $string ) 返回给定的字符串 string 的长度。注意:它返回的是字符串字节的个数,并非字符的个数,假设一个汉字“你”可能会返回3,具体看你用的什么编码mb_strlenint mb_strlen ( string $str [, string $encoding ] ) 返回字符串字符的个数。str具体字符串encodingencoding 参数为字符编码。如果省略,则使用内部字符编码。注意:一定要开启php.ini 文件中的php_mbstring.dll, 阅读全文
posted @ 2012-12-07 10:29 古月天 阅读(6899) 评论(0) 推荐(0) 编辑
摘要: <script type="text/javascript"> //基类 function BaseClass(){ alert('BaseClass'); } BaseClass.prototype.hello = function(){ alert("BaseClass.hello") } //子类 function SubClass(){ alert("SubClass") //覆写父类的方法 this.hello = function(){ ... 阅读全文
posted @ 2012-12-07 09:57 古月天 阅读(182) 评论(0) 推荐(0) 编辑
摘要: function base64_encode (data) { // http://kevin.vanzonneveld.net // + original by: Tyler Akins (http://rumkin.com) // + improved by: Bayron Guevara // + improved by: Thunder.m // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + bugfixed by: Pellentesque Malesua... 阅读全文
posted @ 2012-12-06 19:36 古月天 阅读(493) 评论(0) 推荐(0) 编辑
摘要: 1、停止mysql服务 2、mysqld.exe --skip-grant-tables3、更新密码 UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; FLUSH PRIVILEGES;3、启动mysql服务 阅读全文
posted @ 2012-12-06 16:34 古月天 阅读(175) 评论(0) 推荐(0) 编辑
摘要: App.config 配制<configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> </configSections> <log4net> <logger name="UseAnalysisLog"> <level value="ALL"/> <appender-ref ref=&q 阅读全文
posted @ 2012-12-06 10:33 古月天 阅读(278) 评论(0) 推荐(0) 编辑
摘要: In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.ExecutablesThe following table presents the MySQL/Oracle executables and the corresponding MongoDB executables. MySQL/OracleMongoDBDatabase Se... 阅读全文
posted @ 2012-12-06 09:53 古月天 阅读(3632) 评论(0) 推荐(0) 编辑
摘要: 眼看着数据库就要爆了,从几十M到几十G再到几百G,怎么办能!或许我们第一个想到的就是数据仓库吧,如果时间或者其它原因不允许那有怎么办呢!我们就不得不使用分区暂时死撑着了,好吧,那就开始分区呗!分区类型:·RANGE分区:基于属于一个给定连续区间的列值,把多行分配给分区。·LIST分区:类似于按RANGE分区,区别在于LIST分区是基于列值匹配一个离散值集合中的某个值来进行选择。·HASH分区:基于用户定义的表达式的返回值来进行选择的分区,该表达式使用将要插入到表中的这些行的列值进行计算。这个函数可以包含MySQL 中有效的、产生非负整数值的任何表达式。· 阅读全文
posted @ 2012-12-05 17:17 古月天 阅读(626) 评论(0) 推荐(0) 编辑
摘要: 随着数据量的不断增长,性能尤为重要,或许经过优化及好的解决方案,使你当前感觉不到性能问题的存在,但随着数据量的不断增长,从百万到千万再到几亿,可能问题会随之而来,为了能更好的掌握数据库的运行效率,添加慢日志查询是很有必要的。查看日志相关信息:参数如下:-slow_launch_time如果创建线程的时间超过该秒数,服务器增加Slow_launch_threads状态变量。-slow_query_log是否记录慢查询。用long_query_time变量的值来确定“慢查询”。-slow_query_log_file慢日志文件路径-long_query_time慢日志执行时长(秒),超过设定的时间 阅读全文
posted @ 2012-12-05 16:16 古月天 阅读(6287) 评论(0) 推荐(0) 编辑