Loading

Longxing Blog

Found 6 articles in total "MySQL" article

MySQL automatic backup script

The mysqldump command backs up the data in the database into a text file, and the table structure and data will be stored in the generated text file Back up multiple tables in the database #Back up multiple tables under one database #Username indicates the user name #Pwd indicates the password #Localhost is the database address #Dbname indicates the database name #The table1 and table2 parameters indicate the name of the table to be backed up. If it is empty, the entire database will be backed up mysqldump -u username -p pwd -h localhost --default-character-set=utf8 dbname table1 table2 > BackupNam...

MySQL + Keepalived

MySQL + Keepalived Keep alive+mysql automatic switch Project environment: VIP 192.168.14.110 mysql1 192.168.14.120 mysql2 192.168.14.130 Implementation steps I Keepalived active/standby configuration file 192.168.14.120 Master configuration [ root@localhost ~]# vim /etc/keepalived/keepalived.conf ============================================================== !...

MySQL master-slave practice: read/write separation and dual master-slave hot standby architecture construction of the ultra detailed version

MySQL master-slave practice: super detailed version of reading and writing separation, dual master hot standby architecture building teaching In the first chapter, "Principle of Master Slave", we basically optimized the principle of master slave replication, master slave architecture mode, data synchronization mode, and replication technology When all kinds of details are clear, this chapter is going to really practice the implementation of several master-slave modes, but the content of practice is usually boring, because it is to adjust various configurations, set various parameters and other steps. In this chapter, the configuration process of the two most basic commonly used architectures, one master one slave/multi slave architecture, dual master/multi master multi write architecture, and others, such as cascade replication architecture and multi master one slave architecture, is roughly the same. Therefore, you can draw inferences from one instance. We will not elaborate on the practice here. 1、 CentOS7 Install MySQL 8.0 In fact, building based on Docker container will be more

MySQL 8 Non Docker Deployment Practice Record

The MySQL version installed this time: mysql-8.0.27-linux-glibc2.12-x86_64.tar.xz Operate with root permission Step 1: Download MySQL Method 1: Download from official website Enter the official website: https://dev.mysql.com/downloads/mysql/ The figure above shows that the first is a binary source code package, the second is a binary test package, and the third is a source code package. We choose the first binary version of MySQL, which has been compiled. It does not need to configure, make make install and other steps. It can be used only after configuration. Uninstallation is also convenient, and it can be deleted directly. You can adjust the compilation parameters to maximize the customization of the installation node

MySQL performance related statements

Index #1. Query redundant index select * from sys.schema_redundant_indexes; #2. Query unused conditions select * from sys.schema_unused_indexes; #3. Query index usage select index_name,rows_selected,rows_inserted,rows_updated,rows_deleted from sys.schema_index_statistics where table_schema = 'dbname'; Table correlation #1. Access to query tables se...

Docker MySQL master-slave configuration

Docker MySQL master-slave configuration Run MySQL container docker run -it --name mysql-master -e MYSQL_ROOT_PASSWORD=123456 -d -p 3307:3306 --privileged=true -v /soft/mysql-master/log:/var/log/mysql -v /soft/mysql-master/data:/var/lib/mysql -v /soft/mysql-master/conf:/etc/mysql/conf.d mysql Create my.cnf vim /soft/...