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
ビジュアル Web 開発ツール

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)データベースとテーブルの作成:createdatabaseおよびcreateTableコマンドを使用します。 2)基本操作:挿入、更新、削除、選択。 3)高度な操作:参加、サブクエリ、トランザクション処理。 4)デバッグスキル:構文、データ型、およびアクセス許可を確認します。 5)最適化の提案:インデックスを使用し、選択*を避け、トランザクションを使用します。

MySQLデータベースでは、ユーザーとデータベースの関係は、アクセス許可と表によって定義されます。ユーザーには、データベースにアクセスするためのユーザー名とパスワードがあります。許可は助成金コマンドを通じて付与され、テーブルはCreate Tableコマンドによって作成されます。ユーザーとデータベースの関係を確立するには、データベースを作成し、ユーザーを作成してから許可を付与する必要があります。

MySQLは、Bツリー、ハッシュ、フルテキスト、および空間の4つのインデックスタイプをサポートしています。 1.B-Treeインデックスは、等しい値検索、範囲クエリ、ソートに適しています。 2。ハッシュインデックスは、等しい値検索に適していますが、範囲のクエリとソートをサポートしていません。 3.フルテキストインデックスは、フルテキスト検索に使用され、大量のテキストデータの処理に適しています。 4.空間インデックスは、地理空間データクエリに使用され、GISアプリケーションに適しています。

MySQLとMariaDBは共存できますが、注意して構成する必要があります。重要なのは、さまざまなポート番号とデータディレクトリを各データベースに割り当て、メモリ割り当てやキャッシュサイズなどのパラメーターを調整することです。接続プーリング、アプリケーションの構成、およびバージョンの違いも考慮する必要があり、落とし穴を避けるために慎重にテストして計画する必要があります。 2つのデータベースを同時に実行すると、リソースが制限されている状況でパフォーマンスの問題を引き起こす可能性があります。
