Time of Update: 2017-01-13
假如有個表product有個欄位add_time,它的資料類型為datetime,有人可能會這樣寫sql: 代碼如下複製代碼 select * from product where add_time = '2013-01-12' 對於這種語句,如果你儲存的格式是YY-mm-dd是這樣的,那麼OK,如果你儲存的格式是:2013-01-12 23:23:56這種格式你就悲劇了,這是你就可以使用DATE()函數用來返回日期的部分,所以這條sql應該如下處理:
Time of Update: 2017-01-13
下面來一一說明一下:1.左截取left(str, length)left(str, length)說明:left(被截取欄位,截取長度) 代碼如下複製代碼 mysql> select left('111cn.net', 3);+-------------------------+| left('111cn.net', 3) |+-------------------------+|
Time of Update: 2017-01-13
編譯MysQL時出現了以下錯誤: 代碼如下複製代碼 checking for tgetent in -ltermcap… nochecking for termcap functions library… configure: error: No curses/termcap library found 所安裝mysql版本:5.1.30,在./configure後,make時出現以下錯誤:make: *** No targets
Time of Update: 2017-01-13
先我們要準備配置環境的檔案Nginx 下載地址: http://nginx.org/download/nginx-1.3.14.zipPHP 下載地址: http://windows.php.net/downloads/releases/php-5.2.17-nts-Win32-VC6-x86.zipMySQL 下載地址:http://www.mysql.com/downloads/installer/2、安裝配置nginx: 解壓nginx,修改設定檔: 代碼如下複製代碼
Time of Update: 2017-01-18
問題分析在關閉資料庫的命令發現mysql關不了,提示Warning: World-writable config file '/etc/my.cnf' is ignored ,大概意思是許可權全域可寫,任何一個使用者都可以寫。mysql擔心這種檔案被其他使用者惡意修改,所以忽略掉這個設定檔。這樣mysql無法關閉。下面看下整個過程重啟MySQL[root@ttlsa ~]# service mysqld stopWarning: World-writable config file '/etc/
Time of Update: 2016-09-27
標籤: 通常儲存時間用datetime類型,現在很多系統也用int儲存時間,它們有什麼區別?個人更喜歡使用int這樣對於日期計算時比較好哦,下面我們一起來看到底那種會好些。int(1).4個位元組儲存,INT的長度是4個位元組,儲存空間上比datatime少,int索引儲存空間也相對較小,排序和查詢效率相對較高一點點(2)可讀性極差,無法直觀的看到資料,可能讓你很惱火TIMESTAMP(1)4個位元組儲存(2)值以UTC格式儲存(3)時區轉化
Time of Update: 2016-05-08
標籤:mysql 格式語句規範如何登陸你的資料庫?舉例! 如果你的是 編譯安裝的花 那就得去編譯安裝後的那個目錄中去,我的是安裝到/usr/local/mysql 下 登陸資料庫: cd /usr/local/mysql bin/mysql -u root -p 然後輸入密碼mysql-> show databases; 察看資料庫記住每執行一句要帶; 一、mysql常用語句建立,刪除和最基本查詢:
Time of Update: 2016-01-08
標籤:./configure --prefix=/usr/local/mysql \--without-debug \ #去除 debug 模式.--enable-thread-safe-client \
Time of Update: 2015-10-30
標籤:mycat mysql 主從 讀寫分離 配置 1、不使用Mycat託管MySQL主從伺服器,簡單使用如下配置: <dataNodename="dn1" dataHost="localhost1
Time of Update: 2015-09-08
標籤:需求:使用MyBatis往MySQL資料庫中插入一條記錄後,需要返回該條記錄的自增主索引值。方法:在mapper中指定keyProperty屬性,樣本如下:1 <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.koala.blog.model.Test" >2 insert into test (id, name)3 values
Time of Update: 2015-04-27
標籤:DELIMITER $$ 和 DELIMITER ; DROP PROCEDURE IF EXISTS `pro_follow_getBookBeforeExpired`$$ DECLARE p_ServiceCode VARCHAR(50); SET p_ServiceCode = ‘YYGH‘; IF p_expiredMinute = 0THEN ...;ELSE IF p_expiredMinute >
Time of Update: 2015-04-24
標籤:innodb查看mysql慢查詢日誌,發現有很多update慢查詢記錄# Query_time: 151 Lock_time:0 Rows_sent: 0 Rows_examined:0update table set ...... where
Time of Update: 2015-04-20
標籤:文本函數函數用法描述CONCAT() 建立形如xy的新字串LENGTH() 返回列中儲存的值的長度LEFT()LEFT(column,x)從列的值中返回最左邊的 x 個字元RIGHT()RIGHT(column,x)從列的值中返回最右邊的 x 個字元TRIM() 從儲存的值刪除開頭和結尾的空格UPPER() 把儲存的字串全部大寫LOWER() 把儲存的字串全部小寫SUBSTRING()SUBSTRING(column,
Time of Update: 2015-03-18
標籤:MySQL UUID函數的詳解MySQL中可以有二類用於產生唯一值性質的工具:UUID()函數和自增序列,那麼二者有何區別呢?我們就此對比下各自的特性及異同點:l 都可以實現產生唯一值的功能;l UUID是可以產生時間、空間上都獨一無二的值;自增序列只能產生基於表內的唯一值,且需要搭配使其為唯一的主鍵或唯一索引;l 實現方式不一樣,UUID是隨機+規則群組合而成的,而自增序列是控制一個值逐步增長的;l UUID產生的是字串類型值,固定長度為:
Time of Update: 2014-11-05
標籤:ar 使用 sp 資料 on 問題 代碼 bs as 在我們的日常開發中,你是否遇到過這種情景:查看某條記錄是否存在,不存在的話建立一條新記錄,存在的話更新某些欄位。你的處理方式是不是就是
Time of Update: 2014-10-20
標籤:style blog color io os ar for strong sp mysql 磁碟空間不足錯誤 磁碟空間滿了, 寫不進去了。 141020 09:45:24
Time of Update: 2014-10-05
標籤:corosync drbd mysql規劃: vip:192.168.1.254 rs1:192.168.1.215 rs2:192.168.1.216 一、主機綁定 (rs2相同)[[email
Time of Update: 2014-07-29
標籤:blog 檔案 資料 div 資料庫 sql mysql log @ 把老資料庫中的某個表倒出成sql檔案 $mysql -uroot -p my_db > my_db.sql (輸入密碼)@
Time of Update: 2014-07-28
標籤:os strong sql mysql 字串 rom rac ef 1、從左開始截取字串 left(str, length) 說明:left(被截取欄位,截取長度) 例:select
Time of Update: 2014-07-22
標籤:mysql 設定檔 啟動進程的參數 The MySQL server maintains many system variables that indicate how it is configured. Each system variable has a default value. System variables can be set at server