ProxySQL配置之MySQL服务器配置
备注:文章编写时间201904-201905期间,后续官方在github的更新没有被写入
MySQL服务器配置 [MySQL Server Configuration]
一、在ProxySQL中配置后端MySQL服务器[Configuring Backend MySQL Servers in ProxySQL]
MySQL服务器的配置在mysql_servers表和mysql_replication_hostgroups表(可选)中。
友情提醒:在阅读下部分之前,请确保了解了ProxySQL使用的多层配置系统。
特别注意:
1)如果没有运行LOAD MYSQL SERVERS TO RUNTIME,那么mysql_servers和mysql_replication_hostgroups表中的更改不会生效;
2)如果没有运行SAVE MYSQL SERVERS TO DISK 保存配置到的磁盘,那么mysql_servers和mysql_replication_hostgroups表中的更改
将在重启/崩溃后丢失。
对mysql_servers和mysql_replication_hostgroups的更改将被视为编辑配置文件而不会被保存或让服务重新加载。
二、将mysql服务器配置从MEMORY层复制到RUNTIME层 [Copying mysql servers from memory to runtime]
将MySQL服务器和复制主机组配置信息从MEMORY层数据库加载到RUNTIME层的数据结构在中:
Admin> LOAD MYSQL SERVERS TO RUNTIME;
其他可被接受的别名操作:
Admin> LOAD MYSQL SERVERS TO RUN;
Admin> LOAD MYSQL SERVERS FROM MEM;
Admin> LOAD MYSQL SERVERS FROM MEMORY;
三、将mysql服务器配置从MEMORY层持久化到DISK层[Copying mysql servers from memory to disk]
将MySQL服务器和复制主机组配置信息从MEMORY层数据库保留到DISK的数据库上:
Admin> SAVE MYSQL SERVERS TO DISK;
其他可被接受的别名操作:
Admin> SAVE MYSQL SERVERS FROM MEM;
Admin> SAVE MYSQL SERVERS FROM MEMORY;
四、将mysql服务器配置从RUNTIME层拷贝到MEMORY层[Copying mysql servers from runtime to memory]
将MySQL服务器和复制主机组配置信息从RUNTIME层数据结构保留到MEMORY数据库:
Admin> SAVE MYSQL SERVERS TO MEMORY;
其他可被接受的别名操作:
Admin> SAVE MYSQL SERVERS TO MEM;
Admin> SAVE MYSQL SERVERS FROM RUN;
Admin> SAVE MYSQL SERVERS FROM RUNTIME;
五、将mysql服务器从DISK层复制到MEMORY层[Copying mysql servers from disk to memory]
将MySQL服务器和复制主机组配置信息从DISK层数据库加载到MEMORY层数据库:
Admin> LOAD MYSQL SERVERS TO MEMORY;
其他可被接受的别名操作:
Admin> LOAD MYSQL SERVERS TO MEM;
Admin> LOAD MYSQL SERVERS FROM DISK;
六、新增服务器[Adding a new server]
如果要添加新服务器,必须在mysql_servers表中插入新行以记录相关配置信息。注意,该表有几列是有默认值的。
以下添加了一个具有所有默认配置的新后端(服务器):
Admin> SELECT * FROM mysql_servers;
Empty set (0.00 sec)
Admin> INSERT INTO mysql_servers (hostname) VALUES ('127.0.0.1');
Query OK, 1 row affected (0.00 sec)
Admin> SELECT * FROM mysql_servers\G
*************************** 1. row ***************************
hostgroup_id: 0
hostname: 127.0.0.1
port: 3306
gtid_port: 0
status: ONLINE
weight: 1
compression: 0
max_connections: 1000
max_replication_lag: 0
use_ssl: 0
max_latency_ms: 0
comment:
1 row in set (0.00 sec)
七、将新服务器添加到主机组[Adding new servers to a hostgroup]
Admin> SELECT hostgroup_id,hostname,port FROM mysql_servers;
+--------------+-----------+------+
| hostgroup_id | hostname | port |
+--------------+-----------+------+
| 0 | 127.0.0.1 | 3306 |
+--------------+-----------+------+
1 row in set (0.00 sec)
INSERT INTO mysql_servers (hostgroup_id, hostname ,port)
VALUES (1, '127.0.0.1' ,24801), (1, '127.0.0.1' ,24802), (1,'127.0.0.1' ,24803);
Query OK, 3 rows affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port FROM mysql_servers;
+--------------+-----------+-------+
| hostgroup_id | hostname | port |
+--------------+-----------+-------+
| 0 | 127.0.0.1 | 3306 |
| 1 | 127.0.0.1 | 24801 |
| 1 | 127.0.0.1 | 24802 |
| 1 | 127.0.0.1 | 24803 |
+--------------+-----------+-------+
4 rows in set (0.00 sec)
八、配置与后端的连接数限制[Limiting the number of connections to a backend]
Admin> SELECT hostgroup_id,hostname,port,max_connections FROM mysql_servers;
+--------------+-----------+-------+-----------------+
| hostgroup_id | hostname | port | max_connections |
+--------------+-----------+-------+-----------------+
| 0 | 127.0.0.1 | 3306 | 1000 |
| 1 | 127.0.0.1 | 24801 | 1000 |
| 1 | 127.0.0.1 | 24802 | 1000 |
| 1 | 127.0.0.1 | 24803 | 1000 |
+--------------+-----------+-------+-----------------+
4 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET max_connections=10 WHERE hostname='127.0.0.1' AND port=24802;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,max_connections FROM mysql_servers;
+--------------+-----------+-------+-----------------+
| hostgroup_id | hostname | port | max_connections |
+--------------+-----------+-------+-----------------+
| 0 | 127.0.0.1 | 3306 | 1000 |
| 1 | 127.0.0.1 | 24801 | 1000 |
| 1 | 127.0.0.1 | 24802 | 10 |
| 1 | 127.0.0.1 | 24803 | 1000 |
+--------------+-----------+-------+-----------------+
4 rows in set (0.00 sec)
九、通过改变后端的权重来确定流量的优先级[Prioritizing traffic by changing the weight of a backend]
特别注意:权重仅在主机组内起作用,值越大被分到的流量的几率越多!!
Admin> SELECT hostgroup_id,hostname,port,weight FROM mysql_servers;
+--------------+-----------+-------+--------+
| hostgroup_id | hostname | port | weight |
+--------------+-----------+-------+--------+
| 0 | 127.0.0.1 | 3306 | 1 |
| 1 | 127.0.0.1 | 24801 | 1 |
| 1 | 127.0.0.1 | 24802 | 1 |
| 1 | 127.0.0.1 | 24803 | 1 |
+--------------+-----------+-------+--------+
4 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET weight=1000 WHERE port IN (24803) AND hostgroup_id=1;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,weight FROM mysql_servers;
+--------------+-----------+-------+--------+
| hostgroup_id | hostname | port | weight |
+--------------+-----------+-------+--------+
| 0 | 127.0.0.1 | 3306 | 1 |
| 1 | 127.0.0.1 | 24801 | 1 |
| 1 | 127.0.0.1 | 24802 | 1 |
| 1 | 127.0.0.1 | 24803 | 1000 |
+--------------+-----------+-------+--------+
4 rows in set (0.00 sec)
十、对特定后端使用SSL连接[Using SSL connections for a specific backend]
此示例显示如何为后端配置SSL(一个状态值而已),(但这不是全局配置SSL,全局请移步SSL configuration)。
Admin> SELECT hostgroup_id,hostname,port,use_ssl FROM mysql_servers;
+--------------+-----------+-------+---------+
| hostgroup_id | hostname | port | use_ssl |
+--------------+-----------+-------+---------+
| 0 | 127.0.0.1 | 3306 | 0 |
| 1 | 127.0.0.1 | 24801 | 0 |
| 1 | 127.0.0.1 | 24802 | 0 |
| 1 | 127.0.0.1 | 24803 | 0 |
+--------------+-----------+-------+---------+
4 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET use_ssl=1 WHERE hostname='127.0.0.1' AND port=3306;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,use_ssl FROM mysql_servers;
+--------------+-----------+-------+---------+
| hostgroup_id | hostname | port | use_ssl |
+--------------+-----------+-------+---------+
| 0 | 127.0.0.1 | 3306 | 1 |
| 1 | 127.0.0.1 | 24801 | 0 |
| 1 | 127.0.0.1 | 24802 | 0 |
| 1 | 127.0.0.1 | 24803 | 0 |
+--------------+-----------+-------+---------+
4 rows in set (0.00 sec)
十一、配置自动忽略(有复制延时的SLAVE)的延时阀值 [Automatically shunning slaves with replication lag]
Admin> SELECT hostgroup_id,hostname,port,max_replication_lag FROM mysql_servers;
+--------------+-----------+-------+---------------------+
| hostgroup_id | hostname | port | max_replication_lag |
+--------------+-----------+-------+---------------------+
| 0 | 127.0.0.1 | 3306 | 0 |
| 1 | 127.0.0.1 | 24801 | 0 |
| 1 | 127.0.0.1 | 24802 | 0 |
| 1 | 127.0.0.1 | 24803 | 0 |
+--------------+-----------+-------+---------------------+
4 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET max_replication_lag=30 WHERE hostname='127.0.0.1' AND port=24803;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,max_replication_lag FROM mysql_servers;
+--------------+-----------+-------+---------------------+
| hostgroup_id | hostname | port | max_replication_lag |
+--------------+-----------+-------+---------------------+
| 0 | 127.0.0.1 | 3306 | 0 |
| 1 | 127.0.0.1 | 24801 | 0 |
| 1 | 127.0.0.1 | 24802 | 0 |
| 1 | 127.0.0.1 | 24803 | 30 |
+--------------+-----------+-------+---------------------+
4 rows in set (0.00 sec)
使用此配置后,只有在主从复制延迟超过30秒的情况下,SLAVE才会被自动的暂时忽略。
如果max_replication_lag列设置为零(SET max_replication_lag = 0),则Monitor模块根本不会检查复制延迟,
即使复制延迟超过了阈值。更多信息请参阅参数mysql-monitor_slave_lag_when_null。
十二、将同一个服务器添加到两个不同的主机组[Adding a server to two different hostgroups]
mysql_servers表上的主键为(hostgroup_id,hostname,port);这意味着同一服务器可以存在于两个不同的主机组中。
Admin> SELECT hostgroup_id,hostname,port,weight,max_replication_lag FROM mysql_servers;
+--------------+-----------+-------+--------+---------------------+
| hostgroup_id | hostname | port | weight | max_replication_lag |
+--------------+-----------+-------+--------+---------------------+
| 0 | 127.0.0.1 | 3306 | 1 | 0 |
| 1 | 127.0.0.1 | 24801 | 1 | 0 |
| 1 | 127.0.0.1 | 24802 | 1 | 0 |
| 1 | 127.0.0.1 | 24803 | 1000 | 30 |
+--------------+-----------+-------+--------+---------------------+
4 rows in set (0.00 sec)
Admin> INSERT INTO mysql_servers(hostgroup_id,hostname,port) VALUES (1,'127.0.0.1',3306);
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,weight,max_replication_lag FROM mysql_servers;
+--------------+-----------+-------+--------+---------------------+
| hostgroup_id | hostname | port | weight | max_replication_lag |
+--------------+-----------+-------+--------+---------------------+
| 0 | 127.0.0.1 | 3306 | 1 | 0 |
| 1 | 127.0.0.1 | 24801 | 1 | 0 |
| 1 | 127.0.0.1 | 24802 | 1 | 0 |
| 1 | 127.0.0.1 | 24803 | 1000 | 30 |
| 1 | 127.0.0.1 | 3306 | 1 | 0 |
+--------------+-----------+-------+--------+---------------------+
5 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET max_replication_lag=30, weight=1000;
Query OK, 5 rows affected (0.00 sec)
Admin> UPDATE mysql_servers SET weight=1 WHERE hostname='127.0.0.1' AND hostgroup_id=1 AND port=3306;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,weight,max_replication_lag FROM mysql_servers;
+--------------+-----------+-------+--------+---------------------+
| hostgroup_id | hostname | port | weight | max_replication_lag |
+--------------+-----------+-------+--------+---------------------+
| 0 | 127.0.0.1 | 3306 | 1000 | 30 |
| 1 | 127.0.0.1 | 24801 | 1000 | 30 |
| 1 | 127.0.0.1 | 24802 | 1000 | 30 |
| 1 | 127.0.0.1 | 24803 | 1000 | 30 |
| 1 | 127.0.0.1 | 3306 | 1 | 30 |
+--------------+-----------+-------+--------+---------------------+
5 rows in set (0.00 sec)
在上面的示例中,对于hostgroup为1的组来说,如果配置为提供读取流量,则99.95%的流量将发送到权重为1000的24801、24802和24803
这3台服务器上,而0.05%的流量将正常发送到3306上。如果24801、24802和24803这3台服务器都不可用,那么所有的读取流量都将
发往3306上。
注意:max_replication_lag仅适用于SLAVE节点。如果服务器未启用复制功能,则Monitor不会执行任何操作。
十三、在后端服务器上启用压缩[Enable compression on a backend server]
要启用压缩,只需将mysql_servers.compression列设置为非零值就足够了。
请注意:
1、压缩功能仅在将该设置加载到RUNTIME层后新建立的连接上生效,之前已有连接不生效。
2、这里的压缩是指ProxySQL作为Client与后端MySQL进行通信时,使用的对数据进行压缩的功能,类似MySQL客户端的–compress选项。
MySQL 压缩协议适合的场景是 MySQL 的服务器端和客户端之间传输的数据量很大,或者可用带宽不高的情况,典型的场景有如下两个 :
1> 查询大量的数据,带宽不够(比如导出数据的时候)
2> 复制的时候 binlog 量太大,启用 slave_compressed_protocol 参数进行日志压缩复制。
Admin> SELECT hostgroup_id,hostname,port,compression FROM mysql_servers;
+--------------+-----------+-------+-------------+
| hostgroup_id | hostname | port | compression |
+--------------+-----------+-------+-------------+
| 0 | 127.0.0.1 | 3306 | 0 |
| 1 | 127.0.0.1 | 24801 | 0 |
| 1 | 127.0.0.1 | 24802 | 0 |
| 1 | 127.0.0.1 | 24803 | 0 |
| 1 | 127.0.0.1 | 3306 | 0 |
+--------------+-----------+-------+-------------+
5 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET compression=1 WHERE hostname='127.0.0.1' AND port=24802 AND hostgroup_id=1;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,compression FROM mysql_servers;
+--------------+-----------+-------+-------------+
| hostgroup_id | hostname | port | compression |
+--------------+-----------+-------+-------------+
| 0 | 127.0.0.1 | 3306 | 0 |
| 1 | 127.0.0.1 | 24801 | 0 |
| 1 | 127.0.0.1 | 24802 | 1 |
| 1 | 127.0.0.1 | 24803 | 0 |
| 1 | 127.0.0.1 | 3306 | 0 |
+--------------+-----------+-------+-------------+
5 rows in set (0.00 sec)
十四、安全的禁用后端服务器[Gracefully disabling a backend server]
要安全的禁用后端服务器,需要将其状态更改为 OFFLINE_SOFT 即可。其上活动事务和连接仍将可用,但此后不会向该节点发送新流量。
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
| 1 | 127.0.0.1 | 24802 | ONLINE |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------+
5 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET status='OFFLINE_SOFT' WHERE hostname='127.0.0.1' AND port=24802 AND hostgroup_id=1;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
| 1 | 127.0.0.1 | 24802 | OFFLINE_SOFT |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------------+
5 rows in set (0.00 sec)
十五、即刻禁用后端服务器[Immediately disabling a backend server]
要立即禁用后端服务器,需要将其状态更改为 OFFLINE_HARD 即可。此后,所有当前流量将立即终止,并且不会发送新流量到该节点。
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
| 1 | 127.0.0.1 | 24802 | OFFLINE_SOFT |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------------+
5 rows in set (0.01 sec)
Admin> UPDATE mysql_servers SET status='OFFLINE_HARD' WHERE hostname='127.0.0.1' AND port=24801 AND hostgroup_id=1;
Query OK, 1 row affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | OFFLINE_HARD |
| 1 | 127.0.0.1 | 24802 | OFFLINE_SOFT |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------------+
5 rows in set (0.00 sec)
十六、重新启用脱机/禁用的后端服务器[Re-enabling an offline / disabled backend server]
要将离线的后端重新启用,只需将其状态更改回 ONLINE 就足够了。
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | OFFLINE_HARD |
| 1 | 127.0.0.1 | 24802 | OFFLINE_SOFT |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------------+
5 rows in set (0.00 sec)
Admin> UPDATE mysql_servers SET status='ONLINE' WHERE status NOT IN ('ONLINE'); ==>这里用了NOT,可根据实际情况修改过滤条件
Query OK, 2 rows affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
| 1 | 127.0.0.1 | 24802 | ONLINE |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------+
5 rows in set (0.00 sec)
十七、删除后端服务器[Removing a backend server]
ProxySQL允许将一个后端服务器彻底的删除,只需要将其从mysql_servers表中完全删除即可。
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
| 1 | 127.0.0.1 | 24802 | ONLINE |
| 1 | 127.0.0.1 | 24803 | ONLINE |
| 1 | 127.0.0.1 | 3306 | ONLINE |
+--------------+-----------+-------+--------+
5 rows in set (0.00 sec)
注意:虽然可以直接执行删除操作,但是为了操作的平滑、安全,数据的完整、可控,还是建议先修改状态让其软下线,等待其上执行的所有SQL都结束后再执行后面的删除动作。
Admin> UPDATE mysql_servers SET status='OFFLINE_SOFT' WHERE hostgroup_id=1 AND port IN (3306,24802,24803);
Query OK, 3 rows affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
| 1 | 127.0.0.1 | 24802 | OFFLINE_SOFT |
| 1 | 127.0.0.1 | 24803 | OFFLINE_SOFT |
| 1 | 127.0.0.1 | 3306 | OFFLINE_SOFT |
+--------------+-----------+-------+--------------+
5 rows in set (0.00 sec)
Admin> DELETE FROM mysql_servers WHERE hostgroup_id=1 AND port IN (3306,24802,24803);
Query OK, 3 rows affected (0.00 sec)
Admin> SELECT hostgroup_id,hostname,port,status FROM mysql_servers;
+--------------+-----------+-------+--------+
| hostgroup_id | hostname | port | status |
+--------------+-----------+-------+--------+
| 0 | 127.0.0.1 | 3306 | ONLINE |
| 1 | 127.0.0.1 | 24801 | ONLINE |
+--------------+-----------+-------+--------+
2 rows in set (0.00 sec)
在ProxySQL内部,直接删除后端服务和将其设置为OFFLINE_HARD的方式相同。当执行LOAD MYSQL SERVERS TO RUNTIME时,
Hostgroup_Manager将检测到后端服务器已被删除,并在内部将其标记为OFFLINE_HARD。
ProxySQL配置之MySQL服务器配置的更多相关文章
- ProxySQL 配置详解及读写分离(+GTID)等功能说明 (完整篇)
ProxySQL是灵活强大的MySQL代理层, 是一个能实实在在用在生产环境的MySQL中间件,可以实现读写分离,支持 Query 路由功能,支持动态指定某个 SQL 进行 cache,支持动态加载配 ...
- 如何配置远程mysql服务器
如何配置远程mysql服务器 分配用户权限 可以先看一下目前的用户权限状况: use mysql; select host,user,password from user; 然后分配新的权限给某一用户 ...
- laravel5 数据库配置(MySQL)
laravel5 数据库配置(MySQL) 首先有一个安装完成可以运行的laravel框架. 配置database.php 进入laravel根目录. 在config目录下找到database.php ...
- [mysql]brew 安装 配置 操作 mysql(中文问题)
mac 下卸载mysqldmg mac下mysql的DMG格式安装内有安装文件,却没有卸载文件--很郁闷的事. 网上搜了一下,发现给的方法原来得手动去删. 很多文章记述要删的文件不完整,后来在stac ...
- ubuntu中为hive配置远程MYSQL database
一.安装mysql $ sudo apt-get install mysql-server 启动守护进程 $ sudo service mysql start 二.配置mysql服务与连接器 1.安装 ...
- cas+tomcat+shiro实现单点登录-3-CAS服务器深入配置(连接MYSQL)
目录 1.tomcat添加https安全协议 2.下载cas server端部署到tomcat上 3.CAS服务器深入配置(连接MYSQL) 4.Apache Shiro 集成Cas作为cas cli ...
- MySQL基础配置之mysql的默认字符编码的设置(my.ini设置字符编码) - 转载
MySQL基础配置之mysql的默认字符编码的设置(my.ini设置字符编码) MySQL的默认编码是Latin1,不支持中文,那么如何修改MySQL的默认编码呢,下面以设置UTF-8为例来说明. 需 ...
- mycat配置实现mysql读写分离
需要先把mysql的主从复制配置好,然后才可以开始mycat的配置 m ysql主从复制配置:https://www.cnblogs.com/renjianjun/p/9093062.html myc ...
- Centos7 安装配置优化mysql(mariadb分支)
1.说明 由于在centos7的yum仓库中没有mysql,centos7用mariadb替代了mysql. mariadb是mysql源代码的一个分支, mysql被ORACLE闭源,而mariad ...
随机推荐
- springboot2+jpa+oracle实例
pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="ht ...
- 跟HR在大群吵架是什么体验?
原创不易,求分享.求一键三连 昨天跟HR负责人在公司大群吵了一架,先说结论:我输了... 事情原委是,老板在周一司庆上聊嗨了,说了一句:我觉得打卡没用,建议取消打卡. 下来后老板在公司论坛发了一个问题 ...
- 4-11 CS后台项目-4 及 Redis缓存数据
使用Redis缓存数据 使用Redis可以提高查询效率,一定程度上可以减轻数据库服务器的压力,从而保护了数据库. 通常,应用Redis的场景有: 高频查询,例如:热搜列表.秒杀 改变频率低的数据,例如 ...
- PostgreSQL下的SQL Shell(psql)工具
首发微信公众号:SQL数据库运维 原文链接:https://mp.weixin.qq.com/s?__biz=MzI1NTQyNzg3MQ==&mid=2247485130&idx=1 ...
- Centos7 安装mysql服务器并开启远程访问功能
大二的暑假,波波老师送了一个华为云的服务器给我作测试用,这是我程序员生涯里第一次以root身份拥有一台真实的云服务器 而之前学习的linux知识在这时也派上了用场,自己的物理机用的是ubuntu系统, ...
- github碰到的问题
下载问题 自己编译一下 mvn clear mvn compile mvn package 自己编译之后的文件,然后解压即可,第一次自己傻傻的,直接用源码跑,少报错! 项目预览问题 添加1s即可 下载 ...
- 2022-7-20 第七组 pan小堂 String
字符串 String 字符串部分方法 字符串对象的特点: 1.Java程序中所有双引号引起来的内容,都是String类的对象 2.字符串内容不可变,它们的值在创建后不能被更改(在底层被final修饰, ...
- powershell和cmd对比
前言 计算机啊这东西,本质上是硬件和软件的综合体.如果只有硬件没有软件的话,这也是台辣鸡而已.而计算机软件中最靠近硬件的一层,就是操作系统层. 操作系统有很多种,比如Unix/Linux/Mac OS ...
- 技术分享 | MySQL数据误删除的总结
欢迎来到 GreatSQL社区分享的MySQL技术文章,如有疑问或想学习的内容,可以在下方评论区留言,看到后会进行解答 内容提要 用delete语句 使用drop.truncate删除表以及drop删 ...
- 技术分享 | 在GreatDB分布式部署模式中使用Chaos Mesh做混沌测试
GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源. 1. 需求背景与万里安全数据库软件GreatDB分布式部署模式介绍 1.1 需求背景 混沌测试是检测分布式系统不确定性.建 ...