跳至主要內容

安装MyCat

soulballad环境配置CentOSCentOS约 373 字大约 1 分钟

安装MyCat

CentOS版本:7.7.1908

MyCat版本:1.6.7.3

一、安装MySQL环境

只需要安装,可以不启动MySQL实例;如果MySql客户端为8.0以上版本,mycat使用密码可能会登不上

MySQL环境安装:https://blog.csdn.net/qq_26900081/article/details/103332232

二、安装java环境

java环境安装:https://blog.csdn.net/qq_26900081/article/details/103615841

三、安装MyCat

1、下载安装包

https://github.com/MyCATApache/Mycat-download 这个地址似乎已经不能下载了,使用下面的地址下载

http://dl.mycat.ioopen in new window

我用的:wget http://dl.mycat.io/1.6.7.3/20190927161129/Mycat-server-1.6.7.3-release-20190927161129-linux.tar.gz

2、解压安装包

tar -zxvf Mycat-server-1.6.7.3-release-20190927161129-linux.tar.gz

3、检查本机的hostname在/etc/hosts中存在,否则后面启动mycat可能会出错

env

img

4、添加软链接

ln -s /usr/local/mycat/bin/mycat /etc/init.d/mycat

5、配置java安装目录

vi /usr/local/mycat/conf/wrapper.conf

img

6、启动MyCAT

/usr/local/mycat/mycat/bin/mycat start 或 service mycat start

7、设置开机自启动

chkconfig --add mycat

四、MyCat常用命令与配置

1、常用命令

启动:/usr/local/mycat/mycat/bin/mycat start 或 service mycat start

停止:/usr/local/mycat/mycat/bin/mycat stop 或 service mycat stop

重启:/usr/local/mycat/mycat/bin/mycat restart 或 service mycat restart

查看启动状态:/usr/local/mycat/mycat/bin/mycat status 或 service mycat status

登录MyCat,与登录MySQL一样,只需要更改端口号:mysql -u root -p -P 8066 -h 127.0.0.1

2、查看或配置MyCat用户名、密码和权限

MyCat用户名、密码和权限配置在conf/server.xml文件中

编辑配置文件:vi conf/server.xml

img

CentOS安装MyCat_Bear Coding的博客-CSDN博客open in new window

上次编辑于:
贡献者: soulballad