Skip to content

Category Archives: mysql

mysql中的表显示“使用中”解决办法!

11-Dec-10

方法1: 检查表:CHECK TABLE xxtable 分析表:ANALYZE TABLE xxtable 修复表:REPAIR TABLE xxtable 方法2:如果方法1无法执行,请使用以下语句修复表索引 REPAIR TABLE xxtableUSE_FRM; Related items mysql_insert_id()错误 终于知道wordpress越来越慢的原因(一) mysql慢速(slow log)脚本分析 MySQL中设置自增字段 mysql优化脚本! var escFun = window.encodeURIComponent ? window.encodeURIComponent : escape; var relatedlinks_js = document.createElement(“script”); relatedlinks_js.setAttribute(“charset”, “utf-8″); relatedlinks_js.src = “http://relatedlinks.googlelabs.com/client/client.js?url=” + escFun(document.URL) + “&referrer=” + escFun(document.referrer) + “&relatedlinks_id=10098_5845376649736343543&title=” + escFun(document.title); document.getElementsByTagName(“head”)[0].appendChild(relatedlinks_js);

mysql_insert_id()错误

24-Jan-09

mysql_insert_id –  取得上一步 INSERT 操作产生的 ID int mysql_insert_id ( [resource link_identifier]) mysql_insert_id() 返回给定的 link_identifier 中上一步 INSERT 查询中产生的 AUTO_INCREMENT 的 ID 号。如果没有指定 link_identifier,则使用上一个打开的连接。 如果上一查询没有产生 AUTO_INCREMENT 的值,则 mysql_insert_id() 返回 0。如果需要保存该值以后使用,要确保在产生了值的查询之后立即调用 mysql_insert_id()。 注: MySQL 中的 SQL 函数 LAST_INSERT_ID() 总是保存着最新产生的 AUTO_INCREMENT 值,并且不会在查询语句之间被重置。 警告 mysql_insert_id() 将 MySQL 内部的 C API 函数 mysql_insert_id() 的返回值转换成 long(PHP 中命名为 int)。如果 AUTO_INCREMENT 的列的类型是 BIGINT,则 mysql_insert_id() 返回的值将不正确。可以在 [...]

终于知道wordpress越来越慢的原因(一)

05-Oct-08

最近服务器速度越来越慢,有时候服务器负载经常到达十几甚至看到过二十。博客打开的速度也慢了起来,今天花…

mysql慢速(slow log)脚本分析

04-Oct-08

mysql有一个功能就是可以log下来运行的比较慢的sql语句,默认是没有这个log的,为了开启这个功能,
要修改…

MySQL中设置自增字段

16-Aug-08

MySQL中设置自增字段

alter table album change ALBUM_ID ALBUM_ID bigint not null auto_increment;
alter table album auto_increment=1;

创建:
mysql>create table cc(id int auto_increment,name varchar(20),primary key(id));
修改:
mysql> alter table cc change id id int primary key auto_increment;