Mysql- high availability cluster [master-slave single mode -binlog]

Operation process: Install mysql service respectively in master and slave nodes Set common mysql configurations in master and slave nodes1. Add administrator user, setting: server ID2. Enable binlog to synchronize users3. Add firewall rules Synchronize master node1. Set synchronization information of primary node: file, index location2. View ...

Posted on Mon, 02 Dec 2019 01:29:40 -0500 by mnetsys

Node connects MySQL and encapsulates its addition, deletion, query and modification

Node connects to mysql In this note, the connection between node and mysql will be introduced, and the encapsulated code will be shared, which can be used directly in the project. Install mysql module npm install mysql Connect mysql const mysql = require('mysql'); let connection = mysql.createConnection({ host : 'localhost', user : 'r ...

Posted on Mon, 02 Dec 2019 00:29:48 -0500 by rwwd

MySQL - difference between internal connection and external connection

Difference inner join: take out the matched data in two tables, and do not keep the unmatched data outer join: take out the matched data in the connection table, and the unmatched data will be retained. Its value is NULL Example table users table mysql> select * from users; +----+-------+ | id | name | +----+-------+ ...

Posted on Sun, 01 Dec 2019 22:52:34 -0500 by stormchaser1_1

MySQL proxy no longer supports client login of mysql5.7

I. server environment: [root@VM_82_178_centos ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) [root@VM_82_178_centos ~]# mysql-proxy-0.8.5 is installed on the local virtual machine Using binary system to install mysql5.7 2. Please refer to the following link for MySQL proxy installation process:https://blog.51cto.com/wujia ...

Posted on Sun, 01 Dec 2019 21:57:59 -0500 by Josien

mycat sub table sub database

Environment: master: 192.168.225.128 Slave: 192.168.225.129 There are two databases db01 and db02 on the master and slave respectively. users table is stored in db01 and db02, but it is not divided into tables to query which server is sent randomly. Part of the data in the item table is stored in db02 of the master, and the other part is store ...

Posted on Sun, 01 Dec 2019 18:26:32 -0500 by Ameslee

MySql learning notes: explain index usage

Main contents: introduction to possible_key, key, key_len, ref and rows of explain. 1,possible_key Represents an index that may be used during a query. If there is an index on the field involved in the query, the index will appear in the possible key column to indicate that it may be used, but it is not necessarily used. Example: mysql> exp ...

Posted on Sun, 01 Dec 2019 15:29:04 -0500 by usefulphp

Common splicing statements of MySQL

In MySQL, the CONCAT() function is used to connect multiple strings into one string. With this function, we can splice the sql that we couldn't get in one step. It may be more convenient in our work. Here are some common scenarios. Note: it may be slightly different for lower version 5.7. 1. Query all users by splicing SELECT DISTINCT CONC ...

Posted on Sun, 01 Dec 2019 13:09:04 -0500 by jiayanhuang

Deploy mysql Cluster and persist storage in kubernetes

Environmental Science Primary node: 172.19.2.50 From Node: 172.19.2.51 172.19.2.140 Access mysql through port 30336 of each node after deployment Account root, password abcd1234 For example: mysql -h 172.19.2.50 -P 30336 -uroot -pabcd1234 galera allows data consistency among three nodes of a cluster when deployment is complete When MySQL is ...

Posted on Sun, 01 Dec 2019 01:57:10 -0500 by tmswenson

How to use mongodb+php

Mognodb database connection default format $m = new Mongo(); //In this case, the default port 27017 of the local computer is used. Of course, the remote host such as 192.168.0.4:27017 can also be connected. If the port is 27017, the port can be omitted. Standard connection $m = new Mongo("mongodb://${username}:${password}@localhost"); Example: ...

Posted on Sat, 30 Nov 2019 21:46:28 -0500 by ttroutmpr

Default values of columns in mysql

In MySQL, each field definition contains additional constraints or modifiers, which can be used to increase the constraints on the input data. NULL and NOT NULL modifiers, DEFAULT modifiers, auto increment modifiers. NULL and NOT NULL modifiers This NULL or NOT NULL modifier can be added after each field to specify whether the field can be NUL ...

Posted on Sat, 30 Nov 2019 15:11:18 -0500 by CONFUSIONUK