我的乐与怒

Life, thoughts, stories and ideas.

MySQL Featured

今天又经历了一起MYSQL错误,系统日志中是“服务 mysql 意外停止” Mysql日志中则是:“Plugin ‘FEDERATED’ is disabled” 网站找到第一条解决方案: 1、在MY.INI文件中的 [mysqld] 中增加一行 tmpdir="D:/MySQL/data/" 修改后,还是启动不了,接着我做了第二步,重启正常。 2、删除DATA目录下除数据库文件夹外的其他文

MySQL和MSSQL 查询比较

Current Date and Time MS: SELECT GETDATE() MY: SELECT NOW() Optionally: Use CURDATE() for the date only.Limiting Results MS: SELECT TOP 10 * FROM table WHERE id = 1 MY: SELECT * FROM table WHERE id = 1 LIMIT 10Date Field Default Value MS: DATETIME DEFAULT GETDATE() MY: DATETIME fields cannot have a default value, i.e. “GETDATE()” You must use your INSERT statement to specify CURDATE() for the field. Optionally: Use datatype TIMESTAMP DEFAULT CURRENT_TIMESTAMPCharacter Length MS: LEN() MY: CHARACTER_LENGTH() Aliases: CHAR_LENGTH(), LENGTH()Character Replace MS: REPLACE() works case insensitively MY: REPLACE() works case sensitivelyTrim Functions MS: LTRIM() and RTRIM() MY: TRIM()String Concatenation MS: CONCATENATION USING + (Does not automatically cast operands to compatible types) MY: CONCAT(string, string), which accepts two or more arguments. (Automatically casts values into types which can be concatenated)Auto Increment Field Definition MS: tablename_id INT IDENTITY PRIMARY

MySQL InnoDB表的限制

一个表不能包含超过1000列。 内部最大键长度是3500字节,但MySQL自己限制这个到1024字节。 除了VARCHAR, BLOB和TEXT列,最大行长度稍微小于数据库页的一半。即,最大行长度大约8000字节。LONGBLOB和LONGTEXT列必须小于4GB, 总的行长度,页包括B