Posts tagged mysql

The strangest problem always comes to the simplest answer

1
After installed Apache, MySQL, PHP on Windows 2008 R2 64-bit, I ‘m facing the strangest problem ever. My OS is 64-bit, but Apache, MySQL, PHP are all of 32-bit version. Though MySQL has official 64-bit version released, but I don’t see any benefit while Apache and PHP have not. When phpMyAdmin is installed and setup, [...]

MySQL 对于 COUNT(*) 和 LIMIT 同时使用的 BUG

0
对一个有 29 条记录的表进行如下操作: SELECT COUNT( sys_uia_account.ID ) FROM sys_uia_account结果 29 SELECT COUNT( sys_uia_account.ID ) FROM sys_uia_account LIMIT 10结果 29 SELECT COUNT( sys_uia_account.ID ) FROM sys_uia_account LIMIT 10 , 10没有结果 看来以后使用 COUNT(*) 的时候不能同时使用 LIMIT offset, ROW_COUNT 这种表达方式了。 PS:如果统计全表记录,使用下面的方法会更加快捷: 123SELECT SQL_CALC_FOUND_ROWS *   FROM sys_uia_account; SELECT FOUND_ROWS( ) ; 唯一需要注意的就是,这两个查询必须在一起进行,因为 SQL_CALC_FOUND_ROWS 不对结果进行任何缓存。

MySQL 中用 GKB 来让 UTF-8 字段中的中文按照拼音排序

0
UTF-8 中的中文不是按照拼音排序的,因此对于 使用 UTF-8 编码集的字段就无法按照拼音进行排序,最简单的解决方法就是转成 GBK 编码。 实例代码: 12345SELECT *   FROM `test`   ORDER BY CONVERT( `test`.`name`     USING GBK )   LIMIT 0 , 30 数据库表结构: 12345CREATE TABLE IF NOT EXISTS `test` (   `id` INT(3) NOT NULL AUTO_INCREMENT,   `name` VARCHAR(10) COLLATE utf8_bin NOT NULL,   PRIMARY KEY (`id`) ) ENGINE=InnoDB [...]

A few tips about how to use mysql-5.1-noinstall package

0
HOW-TO Install Download the install package, filename is mysql-noinstall-5.1.22-rc-win32.zip in this case. Extract it to the installation location, traditionally, the MySQL server uses “c:\mysql”, but my option is “e:\HTTPD\mysql”, any location you like is OK. Create your own config file, it’s a good idea to put this file in your MySQL server installation location, not [...]
Go to Top