Time of Update: 2015-04-28
標籤:環境:rehl 6.2 + mysql
Time of Update: 2015-04-28
標籤: 對一顆樹型結構儲存的表進行遞迴查詢,使用navicat for mysql 建立預存程序 pro_show_knowledge, 參數 -- IN `rootId` int ,通過知識點查詢所有子節點資料並插入到暫存資料表 tmp_knowledge_data中。 注意深度的設定 , set max_sp_recursion_depth = 100 ;
Time of Update: 2015-04-28
標籤: 寫在前面的話: 在慢查最佳化1和2裡都反覆強調過 explain 的重要性,但有時候肉眼看不出 explain 結果如何指導最佳化,這時候還需要有一些其他基礎知識的佐助,甚至需要瞭解 MySQL 實現原理,如子查詢慢查最佳化。 看到 SQL 執行計畫中 select_type 欄位中出現“DEPENDENT SUBQUERY”時,要打起精神了! ——MySQL 的子查詢為什麼有時候很糟糕——
Time of Update: 2015-04-28
標籤:mysql date類型 Mysql建立語句中的資料類型包括時間類型,有一下幾類: | DATE | TIME[(fsp)] | TIMESTAMP[(fsp)] | DATETIME[(fsp)] |
Time of Update: 2015-04-28
標籤:1、尋找以前是否裝有mysql先用:yum remove mysql*命令卸載mysql及相關組件命令:rpm -qa|grep -i mysql可以看到如的所示:說明之前安裝了:MySQL-client-5.5.25a-1.rhel5MySQL-server-5.5.25a-1.rhel52、停止mysql服務、刪除之前安裝的mysql刪除命令:rpm -e –nodeps 包名# rpm -ev MySQL-client-5.5.25a-1.rhel5# rpm -ev
Time of Update: 2015-04-27
標籤:1.在Ubuntu software Center中下載mysql;【注:mysql下載下來後好像就安裝上了】2.使用命令檢查mysql是否已安裝上: 2.1 運行sudo netstat -tap | grep mysql命令查看是否有Mysql的連接埠 2.2
Time of Update: 2015-04-28
標籤:mysql 從伺服器切換為主伺服器:步驟如下:1 確認從伺服器已經完成所有同步操作: stop slave io_thread show processlist 直到看到狀態都為:xxx has read all relay log 表示更新都執行完畢2 停止從伺服器slave服務stop slave3 將從伺服器切換為主伺服器: reset master 完成切換。PS: 如果從伺服器設定了 read only
Time of Update: 2015-04-27
標籤:Mysql跨表更新一直是大家所關心的話題,本文介紹mysql多表 update在實踐中幾種不同的寫法 假定我們有兩張表,一張表為Product表存放產品資訊,其中有產品價格列Price;另外一張表是ProductPrice表,我們要將ProductPrice表中的價格欄位Price更新為Price表中價格欄位的80%。 在Mysql中我們有幾種手段可以做到這一點,一種是update table1 t1, table2 ts ...的方式: UPDATE
Time of Update: 2015-04-27
標籤:#表(jc_shop_product )中有一狀態值--是否上架(on_sale) 若由未上架(0)轉為上架(1) 同時設定上架時間(on_sale_time) drop trigger if exists update_on_sale_time_of_product;delimiter // CREATE TRIGGER update_on_sale_
Time of Update: 2015-04-27
標籤:mysqlgroupadd mysqluseradd -r -g mysql mysqlmv mysql-5.5.27-linux2.6-i686/ /usr/local/ln -s mysql-5.5.27-linux2.6-i686/ mysqlcd /usr/local/mysqlchown -R mysql .chgrp -R mysql ./usr/local/mysql/scripts/mysql_install_db
Time of Update: 2015-04-26
標籤:mysql安裝 mysql源碼安裝 徹底卸載mysql 完全卸載mysql linux上安裝mysql 1、基礎環境介紹1.1軟體環境作業系統:redhat linux 6.3Mysql版本:Mysql
Time of Update: 2015-04-28
標籤:參考:http://stackoverflow.com/questions/93128/mysql-error-1153-got-a-packet-bigger-than-max-allowed-packet-bytes用指令碼寫測試資料,在ubuntu上ok,沒想到到centos報1153錯誤。解決方案:登入mysql,執行:set global net_buffer_length=1000000; set global
Time of Update: 2015-04-26
標籤:mysql 日期的欄位都是timeStamp 格式為YYYY-MM-DD hh:mm:ss 如可是直接通過select語句取到的時間在後台列印出的是的格式將取到日期不做任何處理返回給前台又變成了下面的格式所以寫了一個簡單的函數,對從資料庫中取到的時間進行一下處理在返回給前台。函數只是簡單的做了日期拼接,並在小於10的數前補0 function makeDate(date) { try { var newDate =
Time of Update: 2015-04-28
標籤:rpmbuld mysql spec rpmName: mysqlVersion:5.5.25Release: 1%{?dist}License: GPLGroup: applications/databaseURL: http://www.percona.com/redir/downloads/Percona-Server-5.6/LATEST/source/tarball/percona-server-5.6.19-67.0.tar.gz BuildRoot: %{_tmppath}/
Time of Update: 2015-04-28
標籤:linux mysql 實現:yum安裝相應的庫,因為我這台機子還要安裝nginx,php,所以以下的庫都安裝了# yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype
Time of Update: 2015-04-28
標籤:mysql實現:1.
Time of Update: 2015-04-28
標籤:function 伺服器 master 資料庫 mysql 最近碰到一個問題,在mysql
Time of Update: 2015-04-27
標籤:linux下使用yum安裝mysql 1、安裝查看有沒有安裝過: yum list installed mysql* rpm -qa | grep mysql* 查看有沒有安裝包: yum list mysql* 安裝mysql用戶端: yum install mysql 安裝mysql 伺服器端: yum install mysql-server yum install
Time of Update: 2015-04-27
標籤:設定檔 資料恢複 伺服器 master 資料庫 MySQL Binary Log也就是常說的bin-log,,是mysql執行改動產生的二進位記錄檔,其主要作用有兩個:* 資料恢複 * 主從資料庫。用於slave端執行增刪改,保持與master同步。 1.開啟binary
Time of Update: 2015-04-26
標籤:一、配置好yum源之後安裝MySQL、MySQLdb、mysql-devel。yum -y install mysql-server MySQL-python mysql-devel安裝完成後在python環境下執行如下命令,沒有輸出則證明安裝成功。import