1. 程式人生 > >centos6.4下安裝Mycat-5.6.29-mycat-1.6-RELEASE-20161028204710

centos6.4下安裝Mycat-5.6.29-mycat-1.6-RELEASE-20161028204710

Mycat下載可以到官網下載也可以到github上下載

下載路徑:

Mycat安裝

MyCat安裝,需要安裝jdk

上傳並解壓

把MyCat的壓縮包上傳到linux伺服器,並且解壓

安裝步驟

我的安裝在/usr/local

首先把你的進入你MyCat壓縮包的目錄下(我的在/opt/install)

[[email protected] local]# cd /opt/install

[[email protected] install]# tar -xvf Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz -C /usr/local   usr/local

 //解壓並複製到/usr/local

[[email protected] install]# cd /usr/local

[[email protected] local]# ls

bin  etc  games  include  lib  lib64  libexec  mycat  sbin  share  src

[[email protected] local]# cd mycat

[[email protected] mycat]# cd bin

[[email protected] bin]# ./mycat -start     //啟動mycat

Usage: ./mycat { console | start | stop | restart | status | dump }

[[email protected] mycat]# pwd

/usr/local/mycat

[[email protected] mycat]# cd conf

[[email protected] conf]# vi server.xml         //這一步可以省略

<user name="root">
<!--預設使用者:root 密碼:123456-->
                <property name="password">123456</property>
                <property name="schemas">TESTDB</property>
        </user>
<!--預設使用者:user 密碼:user-->
        <user name="user">
                <property name="password">user</property>
                <property name="schemas">TESTDB</property>
                <property name="readOnly">true</property>
        </user>

mysql> create table tb_user(id int,name varchar(30),password varchar(30)); ERROR 1495 (HY000): User readonly

如果出現這個錯可以這樣修改,或者用root登入

注意:

1、這裡配置的是可以連線主庫的兩個使用者

使用者:root   密碼:oldboy 給予此使用者test資料庫增刪改查的許可權。  

使用者:user 密碼:oldboy 給予此使用者test資料庫讀的許可權。 

2、這裡的TESTDB,不一定是你資料庫上的真實庫名,可以任意指定,只要接下來和schema.xml的配置檔案的庫名統一即可

[[email protected] conf]# cd ..

[email protected] mycat]# cd bin

[[email protected] bin]# ./mycat restart  //重啟mycat

Stopping Mycat-server...

Mycat-server was not running.

[[email protected] bin]# firewall-cmd --permanent --add-port=8066/tcp     //mycat預設埠8066,開啟8066埠

Warning: ALREADY_ENABLED: 8066:tcp

success

[[email protected] bin]# firewall-cmd --reload   //重新載入

success

[[email protected] conf]# vi schema.xml

 <dataHost name="localhost1" maxCon="1000" minCon="10" balance="0"
                          writeType="0" dbType="mysql" dbDriver="native" switchType="1"  slaveThreshold="100">
                <heartbeat>select user()</heartbeat>
                <!-- can have multi write hosts -->
                <writeHost host="hostM1" url="localhost:3306" user="root"
                                   password="admin">
                        <!-- can have multi read hosts -->
                        <readHost host="hostS2" url="192.168.1.200:3306" user="root" password="xxx" />
                </writeHost>
                <writeHost host="hostS1" url="localhost:3316" user="root"
                                   password="123456" />
                <!-- <writeHost host="hostM2" url="localhost:3316" user="root" password="123456"/> -->
        </dataHost>

[[email protected] bin]# mysql -uuser -puser -P8066 -h192.168.19.60
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.6.29-mycat-1.6-RELEASE-20161028204710 MyCat Server (OpenCloundDB)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> quit;

也可以連線mysql的圖形化工具了:如圖

啟動

/usr/local/mycat/bin      ./mycat start    啟動
/usr/local/mycat/bin      ./mycat stop     停止
/usr/local/mycat/bin     ./mycat restart  重啟

相關推薦

centos6.4安裝Mycat-5.6.29-mycat-1.6-RELEASE-20161028204710

Mycat下載可以到官網下載也可以到github上下載 下載路徑: Mycat安裝 MyCat安裝,需要安裝jdk 上傳並解壓 把MyCat的壓縮包上傳到linux伺服器,並且解壓 安裝步驟 我的安裝在/usr/local 首先把你的進入你MyCat壓

Centos6.4安裝5.6.42 MySQL Community Server (GPL)

環境:centos 一:首先配置一個靜態ip地址: 這裡採用的是:NAT模式下的靜態IP   1)虛擬機器聯網方式修改成NAT模式   2)進入虛擬機器的 /etc/sysconfig/network-scripts目錄           cd /etc/syscon

centos6.4安裝python3.6.1

編譯 www logs strong file config pro 6.4 tps 1、安裝編譯環境所需包 #yum install zlib-devel bzip2-devel openssl-devel ncurese-devel gcc zli

Centos7.4安裝mysql-5.6.41

mys 但是 啟動mysql ann node 連接 rpm owin pack Centos7.4下安裝mysql-5.6.41二進制包 1、下載mkdir /data/sqlcd /data/sql wget https://cdn.mysql.com//Downloa

CentOS6.4使用Eclipse編譯執行MapReduce程式Hadoop2.6.5

本文是本人按照廈門大學林子雨老師的教程然後自己在使用Eclipse編譯執行MapReduce程式的時候所做的一個部落格教程,意在幫助更多的人。廈門大學林子雨老師的教程地址:http://dblab.xmu.edu.cn/blog/hadoop-build-project-using-ecli

centOS6.4 原始碼安裝Mysql 5.6.39

1、關閉防火牆 service iptables stop chkconfig iptables off setenforce 0 vi /etc/selinux/config SELINUX=permissive 2、配置sysctl.c

centos6.4安裝mysql5.7.18

https chmod stat groupadd grep 內容 nload inf c-c 1、安裝前工作 在安裝前需要確定現在這個系統有沒有 mysql,如果有那麽必須卸載(在 centos7 自帶的是 mariaDb 數據庫,所以第一步是卸載數據庫)。 卸載系統自帶

centos6.9安裝mysql5.5.35

1、將安裝包MySQL-server-5.5.35-1.linux2.6.x86_64通過ssh工具上傳到虛擬機器中。 2、使用命令rpm -ivh MySQL-server-5.5.35-1.linux2.6.x86_64.rpm安裝 過程中出現問題1:  file /usr

CentOS6.10安裝mysql-5.7.24

odi mys 離線 命令 內容 ODB undle ida 限制 卸載原有mysql 因為mysql數據庫在Linux上實在是太流行了 所以目前下載的主流Linux系統版本基本上都集成了mysql數據庫在裏面 我們可以通過如下命令來查看我們的操作系統上是否已經安裝了mys

linux-CentOS6.4安裝oracle11g詳解

目錄:         1.前言         2.安裝環境         3.基本要求         4.修改linux核心配置(可省略)         5.安裝步驟         6.建立資料庫         7.建立監聽        

centos6.4安裝Tomcat7.0的問題

總結一下網上的原因: (1)防火牆是否關閉,參考http://blog.csdn.net/kergp/article/details/9136607 (2)沒有新增阿里雲安全組規則(碰到問題的哥們用的是阿里雲),參考http://bbs.csdn.net/topics/39

Centos6.7安裝mysql5.5

error: Failed dependencies:libc.so.6()(64bit) is needed by MySQL-client-5.6.20-1.el6.x86_64libc.so.6(GLIBC_2.11)(64bit) is needed by MySQL-client-5.6.20-1.

CentOS 6.5安裝Confluence 5.4

shell visible pri fail 文件中 false centos 6 chm var 1、主機信息 IP Confluence Server 10.64.10.2 MySQL Server 10.64.10.11 OS Conflu

Centos6.4tar包安裝最新版Mysql5.6

1.下載 mysql:http://www.mysql.com/downloads/ (需要註冊ORACLE賬號) 版本:mysql-advanced-5.6.21-linux-glibc2.5-x86_64.tar.gz Linux版本:centos6.4 x64 2.安

centos6.8 yum安裝mysql 5.6

centos6.8 yum安裝mysql 5.6一、檢查系統是否安裝其他版本的MYSQL數據 yum list installed | grep mysql yum -y remove mysql-libs.x86_64 二、安裝及配置 wget http://repo.mysql.com/mysql-co

CentOS6.4Mysql數據庫的安裝與配置

商業 storage 不同的 pool use 速度 man aries ora 原文連接:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 說到數據庫,我們大多想到的是關系型數據

centos6.7安裝mysql5.6.22同時解決中文亂碼問題

系統服務 iptable nod -- 1.7 亂碼問題 dport 5.6 復制 1.下載 http://dev.mysql.com/downloads/mysql/ 或者使用wget下載: wget http://dev.mysql.com/get/Do

CentOS6.9上安裝mysql-5.6.36

tmp event 包名 conf cli group tor 進制 ins 本文參考自博客園,鳴謝原作者。 1、準備數據存放的文件系統 新建一個邏輯卷,並將其掛載至特定目錄即可。這裏不再給出過程。 這裏假設其邏輯卷的掛載目錄為/data,而後需要創建/data/mysql

centos 6.4安裝與設置apache服務器

sta process vra 關閉selinux 安裝apache tps all cnblogs tar 1.打開虛擬機開啟centos 6.4系統後進入root用戶下,打開終端,輸入#yum -y install httpd,安裝apache服務器。   輸入命令後到

Centos6.9安裝OpenOffice 4.1.4

software pan x window lan zxvf host ftw jdk1.7 linu # 對一下時間,時間不準,解壓不了yum install -y ntp unzipntpdate -u 202.112.10.36yum install libXext.