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 fileBack 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 upmysqldump -u username -p pwd -h localhost --default-character-set=utf8 dbname table1 table2 > BackupNam...
MySQL master-slave practice: super detailed version of reading and writing separation, dual master hot standby architecture building teachingIn 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 technologyWhen 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.0In fact, building based on Docker container will be more
The MySQL version installed this time: mysql-8.0.27-linux-glibc2.12-x86_64.tar.xzOperate with root permissionStep 1: Download MySQLMethod 1: Download from official websiteEnter 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
Index#1. Query redundant indexselect * from sys.schema_redundant_indexes;#2. Query unused conditionsselect * from sys.schema_unused_indexes;#3. Query index usageselect 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 tablesse...