Background"What are you doing here?" ”"What's the matter?" I have the code unit test, no problem ah! "I was so confused that I ran to the big ops guy."Look at you!" Look! How many alarms, quickly optimize! ”OPS big guy SMS list inside more than 50
Number of connections to MySQL1. View the current number of MySQL connections[[email protected] ~]# mysqladmin-Uroot-p123456 statusuptime:34070Threads:1Questions:8678Slow Queries:0Opens:910Flush tables: + OpenTables4Queries per
PrefaceMySQL database is now the most widely used database system. Working with databases is one of the daily tasks of every Java programmer, and indexing optimization is one of the necessary skills.Why to understand the index real caseCase one: The
As you can see, MySQL is mainly divided into the following components:
Connection Pool Components
Manage services and tools components
SQL Interface Components
Parser component
Optimizer components
Buffer components
Download MySQL 5.7 Two package[[email protected] ~]# wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21-linux-glibc2.5-x86_64.tar.gz
Unzip the MySQL 5.7 binary package to the specified directory[[email protected] ~]# tar zxvf mysql-5.7
Centos7 mariadb MySQL max_connections=214 Unable to modify the problem/etc/my.cnf.d/mariadb-server.cnf[Mysqld]Max_connections = 10000After restarting mariadb max_connections = 214. Here's how to solve the
The MySQL system variables include global variables (globals) and session variables (sessions), the global variable takes effect for all session, and the session variable includes the global variable. MySQL tuning is bound to involve the adjustment
This article refers to the following article:1: "True and dry" MySQL Index and optimization combat2:mysql Statement Execution ProcessSeveral methods of 3:sql optimizationI have divided the SQL statement optimization into three aspects,(this does not
DELETE tbl_name [. *] [, tbl_name[.*]] ...From Table_references[WHERE Where_condition]Now you want to delete the duplicate records and keep the records with the smaller ID numbers.A table simulates multiple table deletions to achieve:(1) Finding
MySQL master-slave introduction MySQL master-slave is also calledReplication, AB replication。 Simply speaking is a and b two machines from the back, write the data on a, the other B will follow the writing data, both data real-time synchronization
MySQL common command, record down, keep the spareGet table structuredesctablecolumnsfromtable;Change table namerenametableto 新表名;Delete a field from a tableALTER TABLE name Drop Col_name[,col_name .......]altertabledrop weight;Add fields to the
Query Section1> all data in query data: SELECT * FROM table name2> the data of an item in the query data: Eg:select id,name from students;3> de-duplicated rows: eg:select distinct gender from students;(means to delete the duplicate row in gender)*
View InnoDB Transaction Table Innodb_trx If there is a transaction thread being lockedSELECT * from INFORMATION_SCHEMA. Innodb_trx;If the ID exists in the sleep thread inside show full processlist, you need to remove the thread manuallyTo manually
MySQL create user and authorizeAuthorized user Grant Grant all permissions specify Source IPGrant All on.(so the table) to ' user1 ' @ ' 1.1.1.1 ' (% pass with so IP) identified by ' 123456a 'Login VerificationError default use of authorization is
I. Reference LibraryMaven Library: mysql:mysql-connector-java:6.0.6Second, the SDK environmentJAVA JDK10Third, the test code PackageCom.mysql.mysqlconnector;ImportJava.sql.*; Public classDbmain { Public Static voidMain (string[]
Table:Select Table_schema,table_name,table_type,engine from Information_schema.tables where Table_schema not in (' Performance_schema ', ' information_schema ', ' MySQL ');View:Select Table_schema,table_name from information_schema.tables where
INSERTInsert one or more rows of data at a time语法:INSERT into [(字段1,字段2...)] VALUES (字段1值,字段2值...), (val21,...)INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);如果有自动递增属性auto_increment,会以新插入的自动递增项最后以起始。http://dev.mysql.com/doc/refman/5.5/en/
Use of database indexes and database IndexesPreface
Write the background management system for testing and use, and find that loading data is slow, with an average of over 1 second. Then I worked with my colleagues to find the cause, from the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service