Skip to content

Instantly share code, notes, and snippets.

View hoannc54's full-sized avatar

Nguyễn Công Hoan hoannc54

  • Hanoi
View GitHub Profile
Can I Remove MySQL Binary Log Yes, as long as the data is replicated to Slave server, it’s safe to remove the file. It’s recommend only remove MySQL Binary Log older than 1 month.
Besides, if Recovery of data is the main concern, it’s recommend to archive MySQL Binary Log.
There are several ways to remove or clean up MySQL Binary Log, it’s not recommend to clean up the file manually, manually means running the remove command.
Remove MySQL Binary Log with RESET MASTER Statement Reset Master statement is uses for new database start up during replication for Master and Slave server. This statement can be used to remove all Binary Log.
To clean up Binary Log on Master Server
@hoannc54
hoannc54 / Dockerfile
Created October 9, 2020 04:58 — forked from morgangiraud/Dockerfile
nginx-proxy to dynamically add/remove virtual host on docker & mac with ease
FROM nginx:alpine
COPY default.conf /etc/nginx/conf.d/.
@hoannc54
hoannc54 / system_usage_log.sh
Created June 17, 2020 07:07 — forked from vuthaihoc/system_usage_log.sh
System usage bash
#!/bin/bash
## Use : ss command
## variable for change :
##
##----------
Timetemp='%H%M'
Time=$(date +"${Timetemp}")
Date=$(date +"%y%m%d")
Yest=$(date --date="1 day ago" +"%y%m%d")
#Day=$(date +"%a")
@hoannc54
hoannc54 / create_mysql5_db.sh
Created June 17, 2020 07:07 — forked from vuthaihoc/create_mysql5_db.sh
Script create db, user and grant permission
#!/bin/bash
# sudo ./mysql-db-create.sh dbname dbuser password
# Functions
ok() { echo -e '\e[32m'$1'\e[m'; } # Green
EXPECTED_ARGS=3
E_BADARGS=65
MYSQL=`which mysql`
<?php
<<<CONFIG
packages:
- "symfony/process:^5.0"
CONFIG;
/**
* Created by PhpStorm.
* User: hocvt
* Date: 2020-04-03
@hoannc54
hoannc54 / latest-ffmpeg-centos7.sh
Last active November 22, 2018 23:43 — forked from bodny/latest-ffmpeg-centos7.sh
Installs latest ffmpeg on Centos 7
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide
yum -y install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
@hoannc54
hoannc54 / apps.yml
Last active July 27, 2018 15:38 — forked from vuthaihoc/apps.yml
Build ffmpeg 4 with fdk-aac x264 x265 xvid lame on centos 6
apps:
- script : /path/to/artisan
name : 'converter'
interpreter : /path/to/php
cwd : /path/to/code
exec_mode: fork
args : args1 args2
autorestart : true
restart_delay : 30000
out_file : /path/to/log/converter.out.log
@hoannc54
hoannc54 / migrate.sh
Created May 28, 2018 09:27 — forked from pedro-santiago/migrate.sh
Upgrade MAMP 4 to Mysql 5.7.18 (on Sierra tested)
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-macos10.12-x86_64.tar.gz
tar xfvz mysql-5.7.18-macos10.12-x86_64.tar.gz
echo "Stopping MAMP"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "Copy Bin"
@hoannc54
hoannc54 / migrate.sh
Created May 11, 2018 02:50 — forked from pepijnblom/migrate.sh
Upgrade MAMP to Mysql 5.7
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.15-osx10.11-x86_64.tar.gz
tar xfvz mysql-5.7*
echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "creating backup"

Source

Chỉ mục hỗn hợp - kiến thức cơ sở MariaDB

Một bhọc bài học nhỏ trong "Chỉ mục hỗn hợp"

Tài lnày tài liệu này tầm thường và có lẽ là nhàm chán, nhưng lại tạo nên nhiều thông tin thú vị, có lẽ điều mà bạn không nhận ra về cách hoạt động đánh chỉ mục của MariaDB và MySQL.

Điều này cũng giải thích [EXPLAIN][1] (đến một mức độ nào đó).