MySQL Sandbox_MySQL

Hi there, today we will learn about an amazing tool that every single MySQL dba must know, I’m talking about MySQL Sandbox.
MySQL Sandbox is developed by Giuseppe Maxia (The Data Charmer), it’s a tool that make the installation of MySQL servers very easy. If you need to quickly create a MySQL instance for test or a replication setup(it supports master slave, circular and master master replication), this it the tool.
INSTALLATION:
Go to http://mysqlsandbox.net/ and get the latest version (I got from launchpad):
yum install perl perl-ExtUtils-MakeMaker perl-Test-Simplewget https://launchpad.net/mysql-sandbox/mysql-sandbox-3/mysql-sandbox-3/+download/MySQL-Sandbox-3.0.44.tar.gztar -zxvf MySQL-Sandbox-3.0.44.tar.gzcd MySQL-Sandbox-3.0.44perl Makefile.PLmakemake testmake install
CREATING A SINGLE SANDBOX:
To create a single sandbox, all you need is the mysql package that you want install and themake_sandbox
command:
[root@localhost ~]# make_sandbox mysql-5.6.17-linux-glibc2.5-i686.tar.gz unpacking /root/mysql-5.6.17-linux-glibc2.5-i686.tar.gzExecuting low_level_make_sandbox --basedir=/root/5.6.17 / --sandbox_directory=msb_5_6_17 / --install_version=5.6 / --sandbox_port=5617 / --no_ver_after_name / --my_clause=log-error=msandbox.err The MySQL Sandbox,version 3.0.44 (C) 2006-2013 Giuseppe Maxiainstalling with the following parameters:upper_directory = /root/sandboxessandbox_directory = msb_5_6_17sandbox_port = 5617check_port = no_check_port = datadir_from = scriptinstall_version = 5.6basedir = /root/5.6.17tmpdir = my_file = operating_system_user = rootdb_user = msandboxremote_access = 127.%bind_address = 127.0.0.1ro_user = msandbox_rorw_user = msandbox_rwrepl_user = rsandboxdb_password = msandboxrepl_password = rsandboxmy_clause = log-error=msandbox.errmaster = slaveof = high_performance = prompt_prefix = mysqlprompt_body =[/h] {/u} (/d) > force = no_ver_after_name = 1verbose = load_grants = 1no_load_grants = no_run = no_show = do you agree? ([Y],n) loading grants.. sandbox server startedYour sandbox server was installed in $HOME/sandboxes/msb_5_6_17
To use it you can call theuse
script inside the sandbox folder:
[root@localhost ~]# $HOME/sandboxes/msb_5_6_17/useWelcome to the MySQL monitor.Commands end with ; or /g.Your MySQL connection id is 3Server version: 5.6.17 MySQL Community Server (GPL)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.mysql [localhost] {msandbox} ((none)) >
You can manage your sandbox by calling the start / stop / restart / status script inside the sandbox folder
CREATING A MASTER SLAVE REPLICATION:
To create a master slave replication topology (by default is set to 1 master and 2 slaves but it can be changed passing the--how_many_nodes
parameter) we will use themake_replication_sandbox
command:
[root@localhost ~]# make_replication_sandbox mysql-5.6.17-linux-glibc2.5-i686.tar.gz installing and starting masterinstalling slave 1installing slave 2starting slave 1.... sandbox server startedstarting slave 2.. sandbox server startedinitializing slave 1initializing slave 2replication directory installed in $HOME/sandboxes/rsandbox_mysql-5_6_17
To use it we can call theuse
script, for replication, the use script will be located inside the nodeN/Master folder:
[root@localhost ~]# #MASTER[root@localhost ~]# /root/sandboxes/rsandbox_mysql-5_6_17/master/use Welcome to the MySQL monitor.Commands end with ; or /g.Your MySQL connection id is 7Server version: 5.6.17-log MySQL Community Server (GPL)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.master [localhost] {msandbox} ((none)) > ^DBye[root@localhost ~]# #SLAVE 1[root@localhost ~]# /root/sandboxes/rsandbox_mysql-5_6_17/node1/use Welcome to the MySQL monitor.Commands end with ; or /g.Your MySQL connection id is 5Server version: 5.6.17-log MySQL Community Server (GPL)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.slave1 [localhost] {msandbox} ((none)) > ^DBye[root@localhost ~]# #SLAVE 2[root@localhost ~]# /root/sandboxes/rsandbox_mysql-5_6_17/node2/use Welcome to the MySQL monitor.Commands end with ; or /g.Your MySQL connection id is 5Server version: 5.6.17-log MySQL Community Server (GPL)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.slave2 [localhost] {msandbox} ((none)) >
On replication sandbox, you can manage the individual sandbox by calling the start / stop / restart / status script inside the node / master folder or you can call the scripts ending with _all located on the sandbox folder (start_all
/stop_all
/restart_all
/status_all
).
CREATING A MULTI MASTER REPLICATION:
To create a multi-master sandbox we will use themake_replication_sandbox
with--master_master
option:
[root@localhost ~]# make_replication_sandbox --master_master mysql-5.6.17-linux-glibc2.5-i686.tar.gzinstalling node 1installing node 2# server: 1: # server: 2: # server: 1: # server: 2: Circular replication activatedgroup directory installed in $HOME/sandboxes/rcsandbox_mysql-5_6_17
That is it, you can find more information using the help parameter onmake_multiple_custom_sandbox make_multiple_sandbox make_replication_sandbox make_sandbox make_sandbox_from_installed and make_sandbox_from_source

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

Video Face Swap
완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











전체 테이블 스캔은 MySQL에서 인덱스를 사용하는 것보다 빠를 수 있습니다. 특정 사례는 다음과 같습니다. 1) 데이터 볼륨은 작습니다. 2) 쿼리가 많은 양의 데이터를 반환 할 때; 3) 인덱스 열이 매우 선택적이지 않은 경우; 4) 복잡한 쿼리시. 쿼리 계획을 분석하고 인덱스 최적화, 과도한 인덱스를 피하고 정기적으로 테이블을 유지 관리하면 실제 응용 프로그램에서 최상의 선택을 할 수 있습니다.

예, MySQL은 Windows 7에 설치 될 수 있으며 Microsoft는 Windows 7 지원을 중단했지만 MySQL은 여전히 호환됩니다. 그러나 설치 프로세스 중에 다음 지점이 표시되어야합니다. Windows 용 MySQL 설치 프로그램을 다운로드하십시오. MySQL의 적절한 버전 (커뮤니티 또는 기업)을 선택하십시오. 설치 프로세스 중에 적절한 설치 디렉토리 및 문자를 선택하십시오. 루트 사용자 비밀번호를 설정하고 올바르게 유지하십시오. 테스트를 위해 데이터베이스에 연결하십시오. Windows 7의 호환성 및 보안 문제에 주목하고 지원되는 운영 체제로 업그레이드하는 것이 좋습니다.

InnoDB의 전체 텍스트 검색 기능은 매우 강력하여 데이터베이스 쿼리 효율성과 대량의 텍스트 데이터를 처리 할 수있는 능력을 크게 향상시킬 수 있습니다. 1) InnoDB는 기본 및 고급 검색 쿼리를 지원하는 역 색인화를 통해 전체 텍스트 검색을 구현합니다. 2) 매치 및 키워드를 사용하여 검색, 부울 모드 및 문구 검색을 지원합니다. 3) 최적화 방법에는 워드 세분화 기술 사용, 인덱스의 주기적 재건 및 캐시 크기 조정, 성능과 정확도를 향상시키는 것이 포함됩니다.

클러스터 인덱스와 비 클러스터 인덱스의 차이점은 1. 클러스터 된 인덱스는 인덱스 구조에 데이터 행을 저장하며, 이는 기본 키 및 범위별로 쿼리에 적합합니다. 2. 클러스터되지 않은 인덱스는 인덱스 키 값과 포인터를 데이터 행으로 저장하며 비 예산 키 열 쿼리에 적합합니다.

MySQL은 오픈 소스 관계형 데이터베이스 관리 시스템입니다. 1) 데이터베이스 및 테이블 작성 : CreateAbase 및 CreateTable 명령을 사용하십시오. 2) 기본 작업 : 삽입, 업데이트, 삭제 및 선택. 3) 고급 운영 : 가입, 하위 쿼리 및 거래 처리. 4) 디버깅 기술 : 확인, 데이터 유형 및 권한을 확인하십시오. 5) 최적화 제안 : 인덱스 사용, 선택을 피하고 거래를 사용하십시오.

MySQL 데이터베이스에서 사용자와 데이터베이스 간의 관계는 권한과 테이블로 정의됩니다. 사용자는 데이터베이스에 액세스 할 수있는 사용자 이름과 비밀번호가 있습니다. 권한은 보조금 명령을 통해 부여되며 테이블은 Create Table 명령에 의해 생성됩니다. 사용자와 데이터베이스 간의 관계를 설정하려면 데이터베이스를 작성하고 사용자를 생성 한 다음 권한을 부여해야합니다.

MySQL은 B-Tree, Hash, Full-Text 및 Spatial의 4 가지 인덱스 유형을 지원합니다. 1.B- 트리 색인은 동일한 값 검색, 범위 쿼리 및 정렬에 적합합니다. 2. 해시 인덱스는 동일한 값 검색에 적합하지만 범위 쿼리 및 정렬을 지원하지 않습니다. 3. 전체 텍스트 색인은 전체 텍스트 검색에 사용되며 다량의 텍스트 데이터를 처리하는 데 적합합니다. 4. 공간 지수는 지리 공간 데이터 쿼리에 사용되며 GIS 응용 프로그램에 적합합니다.

MySQL 및 MariaDB는 공존 할 수 있지만주의해서 구성해야합니다. 열쇠는 각 데이터베이스에 다른 포트 번호와 데이터 디렉토리를 할당하고 메모리 할당 및 캐시 크기와 같은 매개 변수를 조정하는 것입니다. 연결 풀링, 애플리케이션 구성 및 버전 차이도 고려해야하며 함정을 피하기 위해 신중하게 테스트하고 계획해야합니다. 두 개의 데이터베이스를 동시에 실행하면 리소스가 제한되는 상황에서 성능 문제가 발생할 수 있습니다.
