I. Background of the problem To meet the requirements of the superior, a production database needs to implement a backup; Just the vulnerability Scan report, MySQL version needs to upgrade to 5.7.20, so prepare for a rainy day, first write the
The previous time in learning the basics of Python, where to operate MySQL, but always error:Mysql_exceptions. Operationalerror: (2002, "Can ' t connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock ' (2)")Baidu for a long time,
First, prepare the experiment MYSQL Replication Environment: MHA has special requirements for MYSQL replication environment, such as each node to open the binary log and the relay log, each slave node must display the Enable its read-only property,
Integrity constraintsconcept: constraints are the same as the width of the data type, which are optional parametersfunction: used to ensure the integrity and accuracy of data between tables and tablesCan be divided into the following types:PRIMARY
Analysis of several scenarios where MySQL indexing will failIndexes do not always take effect, such as the following, which will invalidate the index:1, if there is an or in the condition, it will not be used even if there is a conditional index
Source: http://www.jb51.net/article/125744.htmTest sql:CREATE TABLE ' test ' ( ' id ' int (8) NOT NULL auto_increment, ' name ' varchar (255) is not NULL, ' list ' varchar (255) N OT NULL, PRIMARY KEY (' id ')) INSERT into ' Test ' VALUES (1, '
1 Modifying table namesRename table AAA to BBB;OrRename table AAA to BBB;2 Modifying the data type of a fieldALTER TABLE person modify name varchar (20);3 modifying field namesALTER TABLE person change stu_name name varchar (25);4 Adding a field
Operations on Table RecordsHttp://www.cnblogs.com/linhaifeng/articles/7267587.htmlAdd: Insert1. Insert full data (sequential insertion)Syntax One:INSERT into table name (Field 1, Field 2, Field 3 ...) field N) VALUES (value 1, value 2, value 3 ...)
1, download MySQLOpen MySQL's official website www.mysql.com, found a downloadsClick on it, go to the MySQL download page, there is a MySQL Community Edition at the bottom of the page, and there is a blue link belowClick on this blue link to go to
First, the data type
See: http://www.runoob.com/mysql/mysql-data-types.html
Ii. Types of choice
Plastic >date,time>enum,char>varchar>blob,text
For data types of the same level, it is preferable to select a data type that occupies
1. The table is as follows:2. Below: Start your Show
1. Check the number of all students who have high grades in the course number "1" than the course number "2";
2, the query average score is more than 60 points of the student's number and
1. Pre-conditions, you need to set the server and MySQL time to the East Eight, php.ini and MY.CNF configuration (refer to the previous article)2, go to MySQL client, recommended navicat for MySQL3, first check whether the function of the timer is
Mysql -- index,1. Create and view Indexes
Common indexes are created without any restrictions (unique or non-empty ). This type of index can be created on any data type field.
(1) create a common index when creating a table
Syntax:
Example:
Mysql -- view,1. view features
When a view comes from multiple basic tables, data cannot be added or deleted.2. Create a view
Although a view can be viewed as a virtual table, it does not physically exist, that is, the database management system
Mysql installation and configuration
I,Configure the MySQL database
1. decompress the green version of mysql and change it to mysql5.7, as shown in figure
Compare versions earlier than 5.6, less data Directories (store data) and my-default.ini
Mysql basics-add, delete, modify, and query, mysql basics-add, delete1. Basic concepts of tables
Each row represents a unique record, and each column represents a field in the record.2. Create a table
Example:
3. view the table structure
(1)
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