MySQL主从读写分离之Proxysql(openEuler版)

实验目的:

基于proxysql实现MySQL的主从读写分离。

实验过程:

前期准备:

一共有四台虚拟机,其中三台为配置好的一主两从虚拟机,还有一台干净的虚拟机用来配置proxysql。

主机名地址
master192.168.27.137
node1192.168.27.139
node2192.168.27.140
proxysql192.168.27.141

proxysql下载:(此处链接为官方,也可进入percona或者github官网进行下载适合的版本)ProxySQL - A High Performance Open Source MySQL Proxyicon-default.png?t=N7T8https://www.proxysql.com/

实验过程:

在proxysql所在虚拟机配置:
下载并安装proxysql以及mysql客户端(mariadb):
[root@localhost ~]# yum install proxysql-2.5.5-1-centos8.x86_64.rpm
[root@localhost ~]# dnf install mariadb
启动proxysql服务:
[root@localhost ~]# systemctl enable --now proxysql
登录proxysql:
[root@localhost ~]# mysql -uadmin -padmin -h 127.0.0.1 -P 6032
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.30 (ProxySQL Admin Module)Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MySQL [(none)]> show databases;//查看数据库
+-----+---------------+-------------------------------------+
| seq | name          | file                                |
+-----+---------------+-------------------------------------+
| 0   | main          |                                     |
| 2   | disk          | /var/lib/proxysql/proxysql.db       |
| 3   | stats         |                                     |
| 4   | monitor       |                                     |
| 5   | stats_history | /var/lib/proxysql/proxysql_stats.db |
+-----+---------------+-------------------------------------+
5 rows in set (0.000 sec)
可见有五个库: main、disk、stats 、monitor 和 stats_history
main: 内存配置数据库,即 MEMORY,表里存放后端 db 实例、用户验证、路由规则等信息。main 库中有如下信息:
MySQL [(none)]> show tables from main;
+----------------------------------------------------+
| tables                                             |
+----------------------------------------------------+
| coredump_filters                                   |
| global_variables                                   |
| mysql_aws_aurora_hostgroups                        |
| mysql_collations                                   |
| mysql_firewall_whitelist_rules                     |
| mysql_firewall_whitelist_sqli_fingerprints         |
| mysql_firewall_whitelist_users                     |
| mysql_galera_hostgroups                            |
| mysql_group_replication_hostgroups                 |
| mysql_hostgroup_attributes                         |
| mysql_query_rules                                  |
| mysql_query_rules_fast_routing                     |
| mysql_replication_hostgroups                       |
| mysql_servers                                      |
| mysql_users                                        |
| proxysql_servers                                   |
| restapi_routes                                     |
| runtime_checksums_values                           |
| runtime_coredump_filters                           |
| runtime_global_variables                           |
| runtime_mysql_aws_aurora_hostgroups                |
| runtime_mysql_firewall_whitelist_rules             |
| runtime_mysql_firewall_whitelist_sqli_fingerprints |
| runtime_mysql_firewall_whitelist_users             |
| runtime_mysql_galera_hostgroups                    |
| runtime_mysql_group_replication_hostgroups         |
| runtime_mysql_hostgroup_attributes                 |
| runtime_mysql_query_rules                          |
| runtime_mysql_query_rules_fast_routing             |
| runtime_mysql_replication_hostgroups               |
| runtime_mysql_servers                              |
| runtime_mysql_users                                |
| runtime_proxysql_servers                           |
| runtime_restapi_routes                             |
| runtime_scheduler                                  |
| scheduler                                          |
+----------------------------------------------------+
36 rows in set (0.001 sec)
mysql_servers: 后端可以连接 MySQL 服务器的列表
mysql_users: 配置后端数据库的账号和监控的账号。
mysql_query_rules: 指定 Query 路由到后端不同服务器的规则列表。
注: 表名以 runtime_开头的表示 ProxySQL 当前运行的配置内容,不能通过 DML 语句修改。
只能修改对应的不以 runtime 开头的表,然后 “LOAD” 使其生效,“SAVE” 使其存到硬盘以供下次重启加载。
在主库(master)中的配置:
创建proxysql的监控账户和对外访问账户:
mysql> create user 'monitor'@'192.168.%.%' identified with mysql_native_password by 'Monitor@123.com';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'monitor'@'192.168.%.%' with grant option;
Query OK, 0 rows affected (0.01 sec)
mysql> create user 'proxysql'@'192.168.%.%' identified with mysql_native_password by '123456';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'proxysql'@'192.168.%.%' with grant option;
Query OK, 0 rows affected (0.00 sec)
配置proxysql:
查看需要用到的表的表结构:
MySQL [(none)]> show create table mysql_replication_hostgroups \G
*************************** 1. row ***************************table: mysql_replication_hostgroups
Create Table: CREATE TABLE mysql_replication_hostgroups (writer_hostgroup INT CHECK (writer_hostgroup>=0) NOT NULL PRIMARY KEY,reader_hostgroup INT NOT NULL CHECK (reader_hostgroup<>writer_hostgroup AND reader_hostgroup>=0),check_type VARCHAR CHECK (LOWER(check_type) IN ('read_only','innodb_read_only','super_read_only','read_only|innodb_read_only','read_only&innodb_read_only')) NOT NULL DEFAULT 'read_only',comment VARCHAR NOT NULL DEFAULT '', UNIQUE (reader_hostgroup))
1 row in set (0.000 sec)
创建新的组(定义写为1,读为0)
MySQL [(none)]>  insert into mysql_replication_hostgroups (writer_hostgroup,reader_hostgroup,comment) values (1,0,'proxy');
Query OK, 1 row affected (0.000 sec)
MySQL [(none)]> load mysql servers to runtime;//加载到当前生效
Query OK, 0 rows affected (0.003 sec)
MySQL [(none)]> save mysql servers to disk;//持久化保存
Query OK, 0 rows affected (0.018 sec)
ProxySQL会根据server的read_only的取值将服务器进行分组。read_only=0的server,master被分到编号为1的写组,read_only=1的server,slave则分到编号为0的读组
MySQL [(none)]> select * from mysql_replication_hostgro
+------------------+------------------+------------+---
| writer_hostgroup | reader_hostgroup | check_type | co
+------------------+------------------+------------+---
| 1                | 0                | read_only  | pr
+------------------+------------------+------------+---
1 row in set (0.000 sec)
添加主从服务器节点:
MySQL [(none)]> insert into mysql_servers(hostgroup_id,hostname,port) values (1,'192.168.27.137',3306);
Query OK, 1 row affected (0.000 sec)
MySQL [(none)]>  insert into mysql_servers(hostgroup_id,hostname,port) values (0,'192.168.27.139',3306);
Query OK, 1 row affected (0.000 sec)
MySQL [(none)]> insert into mysql_servers(hostgroup_id,hostname,port) values (0,'192.168.27.140',3306);
Query OK, 1 row affected (0.000 sec)
MySQL [(none)]> load mysql servers to runtime;
Query OK, 0 rows affected (0.002 sec)
MySQL [(none)]> save mysql servers to disk;
Query OK, 0 rows affected (0.015 sec)
MySQL [(none)]>  select * from mysql_servers;
+--------------+----------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname       | port | gtid_port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+----------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| 1            | 192.168.27.137 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
| 0            | 192.168.27.139 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
| 0            | 192.168.27.140 | 3306 | 0         | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
+--------------+----------------+------+-----------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
3 rows in set (0.000 sec)
为proxysql监控mysql后端节点:
MySQL [(none)]> use monitor//使用monitor
Database changed
MySQL [monitor]> set mysql-monitor_username='monitor';//创建用户 
Query OK, 1 row affected (0.000 sec)
MySQL [monitor]> set mysql-monitor_password='Monitor@123.com';//填写密码
Query OK, 1 row affected (0.000 sec)
MySQL [monitor]>  load mysql variables to runtime;//加载到当前
Query OK, 0 rows affected (0.001 sec)
MySQL [monitor]> save mysql variables to disk;//持久化保存
Query OK, 158 rows affected (0.003 sec)
MySQL [monitor]> select @@mysql-monitor_username;//查看用户名
+--------------------------+
| @@mysql-monitor_username |
+--------------------------+
| monitor                  |
+--------------------------+
1 row in set (0.001 sec)
MySQL [monitor]> select @@mysql-monitor_password;//查看密码
+--------------------------+
| @@mysql-monitor_password |
+--------------------------+
| Monitor@123.com          |
+--------------------------+
1 row in set (0.001 sec)
MySQL [monitor]> select * from monitor.mysql_server_connect_log;//查看日志信息
+----------------+------+------------------+-------------------------+-------------------------------------------------------------------------+
| hostname       | port | time_start_us    | connect_success_time_us | connect_error                                                           |
+----------------+------+------------------+-------------------------+-------------------------------------------------------------------------+
| 192.168.27.140 | 3306 | 1709796180625505 | 0                       | Access denied for user 'monitor'@'192.168.27.141' (using password: YES) |
| 192.168.27.137 | 3306 | 1709796181067381 | 0                       | Access denied for user 'monitor'@'192.168.27.141' (using password: YES) |
| 192.168.27.139 | 3306 | 1709796181508932 | 0                       | Access denied for user 'monitor'@'192.168.27.141' (using password: YES) |
| 192.168.27.140 | 3306 | 1709796240626303 | 0                       | Access denied for user 'monitor'@'192.168.27.141' (using password: YES) |
| 192.168.27.137 | 3306 | 1709796241217740 | 0                       | Access denied for user 'monitor'@'192.168.27.141' (using password: YES) |
| 192.168.27.139 | 3306 | 1709796241809274 | 0                       | Access denied for user 'monitor'@'192.168.27.141' (using password: YES) |
| 192.168.27.139 | 3306 | 1709796300626918 | 0                       | Access denied for user 'monitor'@'192.168.27.141' (using password: YES) |
| 192.168.27.137 | 3306 | 1709796301097796 | 0                       | Access denied for user 'monitor'@'192.168.27.141' (using password: YES) |
| 192.168.27.140 | 3306 | 1709796301568472 | 0                       | Access denied for user 'monitor'@'192.168.27.141' (using password: YES) |
| 192.168.27.139 | 3306 | 1709796306543844 | 1884                    | NULL                                                                    |
| 192.168.27.140 | 3306 | 1709796307338491 | 1778                    | NULL                                                                    |
| 192.168.27.137 | 3306 | 1709796308132494 | 1261                    | NULL                                                                    |
| 192.168.27.137 | 3306 | 1709796366544441 | 1317                    | NULL                                                                    |
| 192.168.27.139 | 3306 | 1709796367110254 | 1339                    | NULL                                                                    |
| 192.168.27.140 | 3306 | 1709796367683285 | 1771                    | NULL                                                                    |
+----------------+------+------------------+-------------------------+-------------------------------------------------------------------------+
15 rows in set (0.000 sec)
查看心跳信息:
MySQL [monitor]> select * from mysql_server_ping_log;
+----------------+------+------------------+--------------------------+
| hostname       | port | time_start_us    | ping_succe               |
+----------------+------+------------------+--------------------------+
| 192.168.27.140 | 3306 | 1709796150706279 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796150706317 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796150707742 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796160707187 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796160707414 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796160709026 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796170707830 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796170707893 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796170709330 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796180708671 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796180708437 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796180711690 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796190709041 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796190709143 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796190710542 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796200709720 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796200709721 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796200710996 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796210710277 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796210710291 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796210711528 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796220711158 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796220711010 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796220712626 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796230711681 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796230711766 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796230712791 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796240712290 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796240712403 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796240714933 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796250712823 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796250712816 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796250714279 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796260713537 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796260713528 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796260715467 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796270714115 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796270714202 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796270715440 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796280714926 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796280715011 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796280716414 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796290715577 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796290715497 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796290718626 | 0         password: YES) |
| 192.168.27.140 | 3306 | 1709796300716091 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796300716161 | 0         password: YES) |
| 192.168.27.139 | 3306 | 1709796300717430 | 0         password: YES) |
| 192.168.27.137 | 3306 | 1709796306725083 | 234                      |
| 192.168.27.140 | 3306 | 1709796306725072 | 160                      |
| 192.168.27.139 | 3306 | 1709796306725193 | 132                      |
| 192.168.27.137 | 3306 | 1709796316725952 | 436                      |
| 192.168.27.139 | 3306 | 1709796316726154 | 259                      |
| 192.168.27.140 | 3306 | 1709796316726119 | 301                      |
| 192.168.27.140 | 3306 | 1709796326726613 | 501                      |
| 192.168.27.139 | 3306 | 1709796326726788 | 353                      |
| 192.168.27.137 | 3306 | 1709796326726752 | 396                      |
| 192.168.27.137 | 3306 | 1709796336726831 | 425                      |
| 192.168.27.140 | 3306 | 1709796336726960 | 319                      |
| 192.168.27.139 | 3306 | 1709796336726942 | 343                      |
| 192.168.27.140 | 3306 | 1709796346742368 | 1308                     |
| 192.168.27.139 | 3306 | 1709796346742539 | 1165                     |
| 192.168.27.137 | 3306 | 1709796346742517 | 1197                     |
| 192.168.27.137 | 3306 | 1709796356743147 | 547                      |
| 192.168.27.140 | 3306 | 1709796356743301 | 425                      |
| 192.168.27.139 | 3306 | 1709796356743278 | 459                      |
| 192.168.27.137 | 3306 | 1709796366743429 | 407                      |
| 192.168.27.140 | 3306 | 1709796366743562 | 291                      |
| 192.168.27.139 | 3306 | 1709796366743545 | 314                      |
| 192.168.27.140 | 3306 | 1709796376745397 | 868                      |
| 192.168.27.139 | 3306 | 1709796376745537 | 752                      |
| 192.168.27.137 | 3306 | 1709796376745518 | 778                      |
| 192.168.27.139 | 3306 | 1709796386745976 | 521                      |
| 192.168.27.140 | 3306 | 1709796386746122 | 406                      |
| 192.168.27.137 | 3306 | 1709796386746109 | 428                      |
| 192.168.27.140 | 3306 | 1709796396746574 | 1349                     |
| 192.168.27.137 | 3306 | 1709796396746710 | 1239                     |
| 192.168.27.139 | 3306 | 1709796396746690 | 1266                     |
| 192.168.27.137 | 3306 | 1709796406747306 | 1100                     |
| 192.168.27.139 | 3306 | 1709796406747510 | 944                      |
| 192.168.27.140 | 3306 | 1709796406747486 | 979                      |
| 192.168.27.139 | 3306 | 1709796416748048 | 431                      |
| 192.168.27.137 | 3306 | 1709796416748195 | 305                      |
| 192.168.27.140 | 3306 | 1709796416748215 | 291                      |
| 192.168.27.139 | 3306 | 1709796426748430 | 797                      |
| 192.168.27.137 | 3306 | 1709796426748565 | 684                      |
| 192.168.27.140 | 3306 | 1709796426748549 | 707                      |
| 192.168.27.140 | 3306 | 1709796436748942 | 551                      |
| 192.168.27.139 | 3306 | 1709796436749096 | 428                      |
| 192.168.27.137 | 3306 | 1709796436749075 | 457                      |
| 192.168.27.139 | 3306 | 1709796446749755 | 677                      |
| 192.168.27.140 | 3306 | 1709796446749900 | 561                      |
| 192.168.27.137 | 3306 | 1709796446749880 | 590                      |
| 192.168.27.137 | 3306 | 1709796456753858 | 1380                     |
| 192.168.27.139 | 3306 | 1709796456754148 | 1129                     |
| 192.168.27.140 | 3306 | 1709796456754111 | 1176                     |
| 192.168.27.140 | 3306 | 1709796466754180 | 882                      |
| 192.168.27.137 | 3306 | 1709796466754360 | 741                      |
| 192.168.27.139 | 3306 | 1709796466754339 | 769                      |
| 192.168.27.137 | 3306 | 1709796476755056 | 389                      |
| 192.168.27.139 | 3306 | 1709796476755239 | 229                      |
| 192.168.27.140 | 3306 | 1709796476755187 | 294                      |
| 192.168.27.139 | 3306 | 1709796486755641 | 441                      |
| 192.168.27.137 | 3306 | 1709796486755703 | 397                      |
| 192.168.27.140 | 3306 | 1709796486755684 | 422                      |
| 192.168.27.137 | 3306 | 1709796496755840 | 479                      |
| 192.168.27.140 | 3306 | 1709796496756003 | 381                      |
| 192.168.27.139 | 3306 | 1709796496755990 | 401                      |
| 192.168.27.139 | 3306 | 1709796506756185 | 348                      |
| 192.168.27.137 | 3306 | 1709796506756298 | 260                      |
| 192.168.27.140 | 3306 | 1709796506756313 | 252                      |
| 192.168.27.140 | 3306 | 1709796516756932 | 517                      |
| 192.168.27.139 | 3306 | 1709796516757138 | 331                      |
| 192.168.27.137 | 3306 | 1709796516757160 | 367                      |
| 192.168.27.140 | 3306 | 1709796526757309 | 337                      |
| 192.168.27.139 | 3306 | 1709796526757433 | 236                      |
| 192.168.27.137 | 3306 | 1709796526757417 | 258                      |
| 192.168.27.139 | 3306 | 1709796536757782 | 458                      |
| 192.168.27.137 | 3306 | 1709796536757910 | 349                      |
| 192.168.27.140 | 3306 | 1709796536757894 | 372                      |
| 192.168.27.140 | 3306 | 1709796546758288 | 477                      |
| 192.168.27.137 | 3306 | 1709796546758460 | 327                      |
| 192.168.27.139 | 3306 | 1709796546758436 | 358                      |
| 192.168.27.137 | 3306 | 1709796556758969 | 473                      |
| 192.168.27.139 | 3306 | 1709796556759144 | 345                      |
| 192.168.27.140 | 3306 | 1709796556759119 | 377                      |
| 192.168.27.140 | 3306 | 1709796566759542 | 440                      |
| 192.168.27.137 | 3306 | 1709796566759671 | 330                      |
| 192.168.27.139 | 3306 | 1709796566759654 | 355                      |
+----------------+------+------------------+--------------------------+
129 rows in set (0.000 sec)
查看read_only监控:
MySQL [monitor]> select * from mysql_server_read_only_log;//此次查询结果报错信息全为0需要进行过更改
对两个从服务器的配置文件进行更改,添加read_only=1让两从文件只课读:
mysql> system vim /etc/my.cnf
mysql> system systemctl restart mysql
再次查看read_only表信息:|
| 192.168.27.137 | 3306 | 1709796956508275 | 485             | 0         | NULL                                                                                        |
| 192.168.27.139 | 3306 | 1709796956508323 | 446             | 1         | NULL                                                                                        |
| 192.168.27.139 | 3306 | 1709796958008641 | 627             | 1         | NULL                                                                                        |
| 192.168.27.140 | 3306 | 1709796958008789 | 516             | 1         | NULL                                                                                        |
| 192.168.27.137 | 3306 | 1709796958008776 | 542             | 0         | NULL    
proxysql配置对外访问账号:
MySQL [monitor]> insert into 
mysql_users(username,password,default_hostgroup,transaction_persistent) values ('proxysql','123456',1,1);
Query OK, 1 row affected (0.000 sec)
MySQL [monitor]> load mysql users to runtime;
Query OK, 0 rows affected (0.000 sec)
MySQL [monitor]> save mysql users to disk;
Query OK, 0 rows affected (0.011 sec)
MySQL [monitor]> select * from mysql_users\G
*************************** 1. row ***************************username: proxysqlpassword: 123456active: 1use_ssl: 0default_hostgroup: 1default_schema: NULLschema_locked: 0
transaction_persistent: 1fast_forward: 0backend: 1frontend: 1max_connections: 10000attributes: comment: 
1 row in set (0.000 sec)
在从库192.168.27.139上通过对方询问账号proxysql连接,是否路由能默认到写组:
[root@node1 ~]# mysql -h192.168.27.141 -uproxysql -p'123456' -P 6033
mysql: [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 2
Server version: 5.5.30 (ProxySQL)Copyright (c) 2000, 2022, Oracle and/or its affiliates.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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| school             |
| sys                |
+--------------------+
5 rows in set (0.01 sec)mysql> select @@server_id;
+-------------+
| @@server_id |
+-------------+
|           1 |
+-------------+
1 row in set (0.00 sec)mysql> create database keme;
Query OK, 1 row affected (0.01 sec)
在从库192.168.27.140上进行验证看是否能查看到keme:
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| keme               |
| mysql              |
| performance_schema |
| school             |
| sys                |
+--------------------+
6 rows in set (0.00 sec)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/733948.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

bat文件给多个Android设备安装apk

本文是安装一个apk 1、确保以下3个文件在同一个目录下 1>要安装的apk&#xff0c;这里是mmb.apk 2>设备名单&#xff0c;保存在.txt文件中&#xff0c;一行一个设备名&#xff0c;设备名通过adb devices获取&#xff0c;截图中是两个设备 txt文件中的样式 3>要运行…

【Pytorch】进阶学习:深入解析 sklearn.metrics 中的 classification_report 函数---分类性能评估的利器

【Pytorch】进阶学习&#xff1a;深入解析 sklearn.metrics 中的 classification_report 函数—分类性能评估的利器 &#x1f308; 个人主页&#xff1a;高斯小哥 &#x1f525; 高质量专栏&#xff1a;Matplotlib之旅&#xff1a;零基础精通数据可视化、Python基础【高质量合…

外包干了3个月,技术退步明显。。。。

先说一下自己的情况&#xff0c;本科生&#xff0c;2019年我通过校招踏入了南京一家软件公司&#xff0c;开始了我的职业生涯。那时的我&#xff0c;满怀热血和憧憬&#xff0c;期待着在这个行业中闯出一片天地。然而&#xff0c;随着时间的推移&#xff0c;我发现自己逐渐陷入…

定制repo(不再切换python和google源)

文章目录 定制repo&#xff08;不再切换python和google源&#xff09;前言各用各的repo定制repo2/repo3源码自动识别repo2/repo3项目完整解决方案&#xff1a; 定制repo&#xff08;不再切换python和google源&#xff09; 众知&#xff0c;Android/AOSP/ROM系统开发&#xff0c…

读算法的陷阱:超级平台、算法垄断与场景欺骗笔记05_共谋(中)

1. 默许共谋 1.1. 又称寡头价格协调&#xff08;Oligopolistic Price Coordination&#xff09;或有意识的平行行为&#xff08;Conscious Parallelism&#xff09; 1.1.1. 在条件允许的情况下&#xff0c;它会发生在市场集中度较高的行业当中 1.1.…

论文笔记 Where Would I Go Next? Large Language Models as Human Mobility Predictor

arxiv 2023 08的论文 1 intro 1.1 人类流动性的独特性 人类流动性的独特特性在于其固有的规律性、随机性以及复杂的时空依赖性 ——>准确预测人们的行踪变得困难近期的研究利用深度学习模型的时空建模能力实现了更好的预测性能 但准确性仍然不足&#xff0c;且产生的结果…

爬虫(五)

1. 前端JS相关 三元运算 v1 条件 ? 值A : 值B; # 如果条件成立v1值A&#xff0c;不成立v1等于值Bres 1 1 ? 99 : 88 # res99特殊的逻辑运算 v1 11 || 22 # Ture v2 9 || 14 # 9 v3 0 || 15 # 15 v3 0 || 15 || "zhangfei" # 15赋值和…

201909 青少年软件编程(Scratch)等级考试试卷(一级)

第1题&#xff1a;【 单选题】 小明在做一个采访的小动画&#xff0c;想让主持人角色说“大家好&#xff01;”3秒钟&#xff0c;用下列程序中的哪一个可以实现呢&#xff1f;&#xff08; &#xff09; A: B: C: D: 【正确答案】: B 【试题解析】 : 第2题&#xff1a…

领域模型设计-COLA架构

前言 当我们需要创建的新应用的时候&#xff0c;往往需要站在一个长远的角度来设计我们的系统架构。有时候我们接手一个老的应用的时候&#xff0c;会发现由于创建之初没有好好规划系统架构&#xff0c;导致我们后期开分成本和维护成本都非常高。近些年来领域模型的系统设计非常…

《AI歌手:音乐产业的未来之音?》

引言 随着人工智能技术的快速发展,AI歌手作为一种新兴的演艺模式逐渐走进了人们的视野。AI歌手以其独特的魅力和无限的潜力引发了人们对于音乐产业未来的思考。本文将围绕AI歌手的音乐呈现、市场认可、替代性以及其他类似AI应用等方面展开讨论,探究AI歌手是否有望成为音乐产…

Matlab|10节点潮流计算程序(通用性强)

主要内容 潮流计算程序matlab 牛拉法 采用matlab对10节点进行潮流计算&#xff0c;采用牛拉法&#xff0c;程序运行可靠&#xff0c;牛拉法实现通用性强&#xff0c;可替换参数形成其他节点系统的潮流计算程序。 下载链接

DDoS和CC攻击的原理

目前最常见的网络攻击方式就是CC攻击和DDoS攻击这两种&#xff0c;很多互联网企业服务器遭到攻击后接入我们德迅云安全高防时会问到&#xff0c;什么是CC攻击&#xff0c;什么又是DDoS攻击&#xff0c;这两个有什么区别的&#xff0c;其实清楚它们的攻击原理&#xff0c;也就知…

攻击技术:命令和控制服务器(C2)是什么意思

在攻击者使用的众多策略中&#xff0c;最阴险的策略之一是命令和控制服务器&#xff08;C2&#xff09;。通过这篇文章&#xff0c;我们想准确地解释它是什么。 这些服务器充当计算机黑客行动的大脑&#xff0c;协调受感染设备的操作并允许攻击者随意操纵它们。 在网络安全领…

AJAX学习(一)

版权声明 本文章来源于B站上的某马课程&#xff0c;由本人整理&#xff0c;仅供学习交流使用。如涉及侵权问题&#xff0c;请立即与本人联系&#xff0c;本人将积极配合删除相关内容。感谢理解和支持&#xff0c;本人致力于维护原创作品的权益&#xff0c;共同营造一个尊重知识…

Apache的运用与实战

WEB服务器 1、WEB服务简介 # 目前最主流的三个Web服务器是Apache、Nginx、 IIS。 - WEB服务器一般指网站服务器&#xff0c;可以向浏览器等Web客户端提供网站的访问&#xff0c;让全世界浏览。 - WEB服务器也称为WWW(WORLD WIDE WEB)服务器&#xff0c;主要功能是提供网上信息…

Feign实现微服务间远程调用续;基于Redis实现消息队列用于延迟任务的处理,Redis分布式锁的实现;(黑马头条Day05)

目录 延迟任务和定时任务 使用Redis设计延迟队列原理 点评项目中选用list和zset两种数据结构进行实现 如何缓解Redis内存的压力同时保证Redis中任务能够被正确消费不丢失 系统流程设计 使用Feign实现微服务间的任务消费以及文章自动审核 系统微服务功能介绍 提交文章-&g…

stable diffusion 零基础入门教程

一、前言 Midjourney 生成的图片很难精准的控制&#xff0c;随机性很高&#xff0c;需要大量的跑图&#xff0c;但Stable Diffusion可以根据模型较精准的控制。 SD 效果图展示&#xff1a; 二、Stable Diffusion 介绍 Stable Diffusion 是一款基于人工智能技术开发的绘画软件…

IM6ULL学习总结(四-七-1)输入系统应用编程

第7章 输入系统应用编程 7.1 什么是输入系统 ⚫ 先来了解什么是输入设备&#xff1f; 常见的输入设备有键盘、鼠标、遥控杆、书写板、触摸屏等等,用户通过这些输入设备与 Linux 系统进行数据交换。 ⚫ 什么是输入系统&#xff1f; 输入设备种类繁多&#xff0c;能否统一它们的…

ZJUBCA研报分享 | 《BTC/USDT周内效应研究》

ZJUBCA研报分享 引言 2023 年 11 月 — 2024 年初&#xff0c;浙大链协顺利举办为期 6 周的浙大链协加密创投训练营 &#xff08;ZJUBCA Community Crypto VC Course&#xff09;。在本次训练营中&#xff0c;我们组织了投研比赛&#xff0c;鼓励学员分析感兴趣的 Web3 前沿话题…

深度学习图像算法工程师--面试准备(2)

深度学习面试准备 深度学习图像算法工程师–面试准备&#xff08;1&#xff09; 深度学习图像算法工程师–面试准备&#xff08;2&#xff09; 文章目录 深度学习面试准备前言一、Batch Normalization(批归一化)1.1 具体步骤1.2 BN一般用在网络的哪个部分 二、Layer Normaliza…