tidb 单机版安装部署

服务器配置:

vm虚机 ubuntu 16.04

安装部署

TIdb 单机测试环境安装

centos7:

wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm 
yum install -y mysql57-community-release-el7-11.noarch.rpm 
yum install -y mysql-community-client.x86_64 


ubuntu16.04:

apt-get install mysql-client mysql-server

下载安装tidb

wget http://download.pingcap.org/tidb-latest-linux-amd64.tar.gz
mkdir -p /data/pd
mkdir -p /data/tikv
mv tidb-latest-linux-amd64.tar.gz  /usr/local/
cd /usr/local/
tar xf tidb-latest-linux-amd64.tar.gz 
ln -s tidb-latest-linux-amd64 tidb
cd /usr/local/tidb
./bin/pd-server --data-dir=/data/pd --log-file=pd.log &
./bin/tikv-server --pd="127.0.0.1:2379" --data-dir=/data/tikv --log-file=tikv.log &
./bin/tidb-server --store=tikv --path="127.0.0.1:2379" --log-file=tidb.log &

查看服务端口

   root@ubuntu:/data# netstat -lntp
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      88086/mysqld    
    tcp        0      0 127.0.0.1:2379          0.0.0.0:*               LISTEN      100294/pd-server
    tcp        0      0 127.0.0.1:2380          0.0.0.0:*               LISTEN      100294/pd-server
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      839/sshd        
    tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      100193/0        
    tcp        0      0 127.0.0.1:6011          0.0.0.0:*               LISTEN      100355/1        
    tcp6       0      0 :::8080                 :::*                    LISTEN      38175/java      
    tcp6       0      0 :::22                   :::*                    LISTEN      839/sshd        
    tcp6       0      0 ::1:6010                :::*                    LISTEN      100193/0        
    tcp6       0      0 ::1:6011                :::*                    LISTEN      100355/1        
    tcp6       0      0 :::10080                :::*                    LISTEN      100510/tidb-server
    tcp6       0      0 :::4000                 :::*                    LISTEN      100510/tidb-server
    tcp6       0      0 127.0.0.1:20160         :::*                    LISTEN      100386/tikv-server
    tcp6       0      0 127.0.0.1:20160         :::*                    LISTEN      100386/tikv-server
    tcp6       0      0 127.0.0.1:20160         :::*                    LISTEN      100386/tikv-server
    tcp6       0      0 127.0.0.1:20160         :::*                    LISTEN      100386/tikv-server

使用:

 mysql -h 127.0.0.1 -P 4000 -u root -D test

功能测试

grant all privileges on *.* to 'oracle'@'%' identified by 'oracle' with grant option;
flush  privileges;

创建用户

CREATE USER 'ggs'@'%' IDENTIFIED BY 'oracle';
set password for ggs=password('oracle');

GRANT ALL PRIVILEGES ON *.* TO 'ggs'@'%' with grant option;
flush  privileges;


grant all privileges on *.* to 'root'@'localhost' identified by 'oracle' with grant option;
grant all privileges on *.* to 'root'@'%' identified by 'oracle' with grant option;
grant all privileges on *.* to 'root'@'127.0.0.1' identified by 'oracle' with grant option;
flush  privileges;

web浏览

http://ip:10080

上一篇:docker-compose.yml方式搭建好测试环境的TiDB


下一篇:【TIDB】4、业界使用情况