Time of Update: 2016-01-29
標籤:在5.6版本中,MySQL可以通過mysql_config_editor登入資料庫,變得更加安全。[[email protected] ~]# mysql_config_editor set --login-path=yoon --user=root --password登入資料庫:[[email protected] ~]# mysql --login-path=yoonWelcome to the MySQL monitor. Commands end
Time of Update: 2016-01-29
標籤:版本:5.7.9新裝的CentOS 6.3 安裝MySQL 5.7.9 出現的問題1、首先卸載系統內建的mysql 5.1的包 yum -y remove mysql-libs-5.1.61-4.el6.x86_642、開始安裝MySQL 5.7.9的包3、報錯:warning: mysql-community-server-5.7.9-1.el6.x86_64.rpm: Header V3 DSA/SHA1
Time of Update: 2016-01-29
標籤:原文地址:MySQL被慢sql hang住了,用shell指令碼快速清除不斷增長的慢sql的辦法 mchdba 某個初級dba誤刪index,mysql漫山遍野全是10S以上的慢sql,mysql服務被hang住了,而且慢sql不斷在增加中,如果手動在mysql介面kill的話,根本來不及,這個時候,shell就必須要出手了,如下的shell指令碼,大家可以參考: #It is used to kill processlist of mysql
Time of Update: 2016-01-29
標籤:在MySQL資料庫中,建立複合索引的時候,不知道在建立過程中哪個列在前面,哪個列該在後面,用以下方式即可:select count(distinct first_name)/count(*) as first_name_selectivity,count(distinct last_name)/count(*) as last_name_selectivity,count(*)from actor\Gmysql> select count(distinct
Time of Update: 2016-01-29
標籤:[[email protected] log]# pt-query-digest slowq.log# 200ms user time, 10ms system time, 24.39M rss, 205.12M vsz# Current date: Thu Dec 17 15:32:04 2015# Hostname: hank-yoon.com# Files: slowq.log# Overall: 8 total, 2 unique, 0.00 QPS, 0.00x
Time of Update: 2016-01-29
標籤:MySQL主從損毀修復測試庫:192.168.1.2 主192.168.1.3 從192.168.1.4 主 4又是2的從庫192.168.1.5
Time of Update: 2016-01-29
標籤:mysql> create table tb_test (id int(10) not null auto_increment primary key,action_id int(10) not null,error_code int(10) not null default 0,desc_key varchar(64) not null default ‘audit.log.default‘,INDEX(action_id),constraint `FK_ACTIONID`
Time of Update: 2016-01-29
標籤:5.6.26源碼安裝包:http://pan.baidu.com/s/1kUl44WRcmake安裝包連結:http://pan.baidu.com/s/1c0LuwJA作業系統版本:CentOS release 6.3 (Final)安裝過程:(記得掛載鏡像,並且配置yum,方便yum安裝各種依賴的包)CentOS配置yum:1、cd /etc/yum.repos.d2、建立個任意目錄,將所有檔案移動到建立的目錄中,除了CentOS-Media.repo3、編輯CentOS-
Time of Update: 2016-01-29
標籤:資料庫版本 5.6.16在兩個伺服器上,存在不同名字的資料庫,但是兩個資料庫中的所有表結構相同,實現主從複製。主程式庫伺服器的資料庫名為yoon,從程式庫伺服器的庫名為hank在從庫的my.cnf設定檔中添加如下參數,並重啟資料庫replicate-rewrite-db = yoon -> hank設定主從:change master to master_host=‘172.16.9.243‘,master_port=3306,master_user=‘master‘,master_
Time of Update: 2016-01-29
標籤:資料庫版本:5.6.16問題:開發來電話說倉庫無法下單,程式插入資料提示:入庫單 xxxx1589762285確認失敗:Duplicate entry ‘8388607‘ for key ‘PRIMARY‘查看資料庫表結構:show create table table_name;表結構的欄位為主鍵自增,應該沒問題啊,仔細一看發現表結構id類型如下:`id` mediumint(8) NOT NULL AUTO_INCREMENT欄位類型為mediumint,支援的最大值為83
Time of Update: 2016-01-29
標籤:發現有一個工具mysqlsla,分析查詢日誌比 mysqldumpslow分析的會更清晰明了!安裝mysqlsla:下載mysqlsla-2.03.tar.gz[[email protected] export]# tar -xvf mysqlsla-2.03.tar.gz[[email protected] export]# yum install *DBI*[[email protected] mysqlsla-2.03]# perl
Time of Update: 2016-01-29
標籤:如果大批量的操作能夠通過一系列的select語句產生,那麼理論上就能對這些結果批量處理。但是mysql並沒用提供eval這樣的對結果集進行分析操作的功能。所以只能現將select結果儲存到臨時檔案中,然後再執行臨時檔案中的指令。具體過程如下:mysql> SELECT concat(‘KILL ‘,id,‘;‘) FROM information_schema.processlist WHERE user=‘root‘;+------------------------+|
Time of Update: 2016-01-29
標籤:常用的mysql show命令如下:1、show databases; 顯示mysql中所有資料庫2、show tables [from databases] ; 顯示當前資料庫中所有的表的名稱3、show columns from tables; 顯示表中列的名稱,於desc
Time of Update: 2016-01-29
標籤:在預設下,MySQL在use databasename的時候,是不顯示串連的庫名!mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || hank || mysql
Time of Update: 2016-01-29
標籤:MYSQL-建立資料庫及使用者名稱:mysql> create database yoon;Query OK, 1 row affected (0.00 sec) mysql> grant all privileges on yoon.* to ‘yoon‘@‘%‘ identified by ‘yoon‘;Query OK, 0 rows affected (0.00 sec) mysql> flush
Time of Update: 2016-01-29
標籤:原文地址:使用Anemometer基於pt-query-digest將MySQL慢查詢可視化 84223932 本文主要介紹使用Anemometer基於pt-query-digest將MySQL慢查詢可視化,因為網上資料相對較少,且都是英文的,遇到報錯也沒有相關的參考資料,因此寫此文。歡迎轉載,請註明作者、出處。張正blog:http://space.itpub.net/26355921 QQ:176036317如有疑問,歡迎聯絡。準備條件:1.MySQL開啟
Time of Update: 2016-01-29
標籤:MySQL主從由於ibdata1佔滿磁碟空間-->主從失效因為設定了innodb_file_per_table = 1,ibdata1依舊撐爆佔滿磁碟空間主從斷的時候,IO線程在串連,SQL線程斷掉。想要瞭解為何ibdata1增長那麼大?個人這麼理解的:主從斷掉,IO線程在,擷取到了事件事物的更新,而SQL線程斷掉,導致產生大量的undo,撐爆了ibdata1。最終驗證發現,確實是undo佔滿了ibdata1.下載一個小工具:py_innodb_page_info.py
Time of Update: 2016-01-29
標籤:用mysqlbinlog查出需要查看的資料後,可以用more來查看:[[email protected] data]# more recover_sakila.sql | grep --ignore-case -E ‘insert‘ -A2 -B2 | grep yoon如果表名包含yoon_log,yoon_order,只想匯出yoon表的話,+個-w[[email protected] data]# more recover_sakila.sql | grep --
Time of Update: 2016-01-29
標籤:首先配置keepalived。連結如下:http://blog.itpub.net/28939273/viewspace-1808369/主伺服器keepalived的設定檔內容如下:[[email protected] keepalived]# cat keepalived.conf vrrp_script check_mysql_port { script
Time of Update: 2016-01-29
標籤:Linux中使用最廣泛的資料庫就是MySQL,使用線上yum的方式安裝的版本落後MySQL網站好幾個小版本,所以折騰了幾個星期,終於在CentOS 裝好了mysql5.6,裝完之後,對整個linux的操作,有提升了一個檔次。下面講講我在安裝mysql中遇到的問題測試機器環境:VMware Workstation 12 虛擬機器記憶體:2GLinux版本:CentOS MinimalCD 6.5按照mysql 版本 MySQL-5.6.28-1.el6.i686.rpm-