Directory1. Tips2. Transaction (transaction)3. Indexes (Index)4. Export and backup of database5. Functions6. Anti-SQL injection7. Parsing SQL statements using explain8. Views (view)1 , Tips1), the database is not case-sensitive;2), when inserting
Solution 1:This is a mechanism of MySQL itself:MySQL automatically disconnects the connection after more than 8 hours of idle timeThere are two solutions:1. Modify MySQL ConfigurationIncrease the value of the MySQL Wait_timeout property2, regular
Do the project process encountered the need to insert an ordered test data, do not want to write PHP loop, online Find methods, review the stored procedure again haha.SQL statement Reference from
There are a few things to keep in mind when establishing a primary foreign key for MySQL data tables:The storage engine for the two tables that need to establish a primary foreign key relationship must be innodb.Foreign key columns and reference
There was this problem at the time of development today.Incorrect string value: ' \xe6\x97\xb7\xe5\x85\xa8 ' for column ' Sz_name ' at row 1Scene, inserting the Chinese parameter into the table in the MySQL database, throws this exceptionWhen I
Build MySQL master-slave replication installation Environment:Two CentOS 7 virtual machinesFirst, set up time synchronization environment, on the master node to build time synchronization Server master server Settings 1, install NTP[[email protected]
MySQL master-slave replication and read-write separation pre-test environment preparation
Linux two units
MySQL database one master one from
Start building MySQL master server installation NTP[[email protected] ~] yum install ntp
1. Now we create a new directory (if the error does not have which folder is created step-by-step)[Email protected] mysql]# mkdir/var/lib/data/mysql/2, MV or CP raw database data Catalog fileFirst look at the current data file size:Du-h--max-depth=1
Sometimes in order to avoid master.info and relay log crashes, the cost of tolerating extra Fsync () is recommended to setSync_master_info = 1Sync_relay_log = 1Sync_relay_log_info = 1Of course, if the standby and the main library latency is
1. Download the source package#wget? https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.17.tar.gz2. Go to unzip directoryCD mysql-5.7.173. Installation related dependencies[email protected] mysql-5.7.17]# Yum install-y cmake gcc-c++* make
First, download the MySQL websiteOpen official Website address: www.mysql.com, select DOWNLOADS, go to the MySQL download page, at the bottom of the page there is a MySQL Community Edition, and there is a blue link belowClick to go to the download
mysql> ALTER TABLE name modify column field name type;For exampleThe Address Table City field in the database is varchar (30)Modification types can be used (careful modification of types may result in errors in existing data)mysql> ALTER TABLE
1. Adding and removing changes and checking operationInquire:SELECT * from table name where field name operator number/character;Modify:Update table name SET field name = value,... where field name operator number/characterDelete:Delete from table
Shortly before the interview, was asked to InnoDB engine table How to change the database name, then I only answered the MyISAM how to operate, by some details of the problem defeated, really fucked.If it represents MyISAM then you can go directly
MySQL group replication implements a multi-master update based on the replication protocol (single master mode).A replication group consists of multiple server members, and each server member in the group can perform transactions independently.
Environment preparation
Mysql-8.0.11-winx64.zip:https://cdn.mysql.com//downloads/mysql-8.0/mysql-8.0.11-winx64.zipInstallation environment: Windows7.
Extract
Unzip the Mysql-8.0.11-winx64.zip installation package to any directory (
A problemThe requirement is to send the link message asynchronously to IM, so there is a message table that sends the failed data each time the query is sent, and locks the data on those rows (so that other threads are not queried again to send the
Host
Operating System
IP Address
main software
Master
Centos7.3x64
192.168.200.132
MySQL 5.5.24
Slave1
Centos7.3x64
192.168.200.130
MySQL 5.5.24
Slave2
MySQL master-slave copy function principle1, in the business complex system, there is a scenario, there is a SQL statement need to lock the table, resulting in the temporary inability to use the Read service, then it will affect the operation of the
MySQL default sort:https://forums.mysql.com/read.php?21,239471,239688#msg-239688
depend on order when order by is missing.
Always specify order by if you want a particular order – in some situations the engine can eliminate the order by
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