简介
TiDB 是一款定位于在线事务处理/在线分析处理( HTAP: Hybrid Transactional/Analytical Processing)的融合型数据库产品,实现了一键水平伸缩、强一致性的多副本数据安全、分布式事务、实时 OLAP
等重要特性,同时兼容 MySQL 协议和生态,迁移便捷,运维成本极低。
部署
1. 安装依赖包
1 | $ yum -y install libtool zlib-devel autoconf readline-devel readline libuuid-devel zlib-devel automake libuuid readline-devel readline ncurses-devel.x86_64 ncurses.x86_64 gcc-c++ vim wget net-tools svn libstdc++.so.6 glibc.i686 unzip make lrzsz libtool zlib-devel autoconf readline-devel readline libuuid-devel zlib-devel automake libuuid readline-devel readline ncurses-devel.x86_64 ncurses.x86_64 gcc-c++ vim wget net-tools svn libstdc++.so.6 libcurl-dev libcurl-devel expat-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker zip git gcc openssl-devel libnl3-devel net-snmp-devel libnfnetlink-devel zlib zlib-devel openssl openssl-devel tree lrzsz tree net-tools nmap vim bash-completion lsof dos2unix nc telnet ntp wget rng-tools psmisc screen pcre pcre-devel |
2. 安装 TiDB
1 | $ cd /usr/local/ |
3. 启动 PD
1 | $ cd bin |
4. 启动 TiKV
1 | $ ./tikv-server --pd="127.0.0.1:2379" --data-dir=/data/tidb/tikv --log-file=/data/tidb/log/tikv.log & |
5. 连接 TiDB
1 | $ mysql -h 127.0.0.1 -P 4000 -u root |
6. 修改密码
1 | mysql> use mysql; |
7. 设置远程可访问
1 | mysql> grant all privileges on *.* to 'root'@'%' identified by 'Changeme_123'; |