Union query: Multiple queries (multiple SELECT statements), stitching on records (fields do not increase)basic Syntax: Multiple SELECT statement composition: The number of fields that each SELECT statement obtains must be strictly consistent (but
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
1.RPM Package Installation MethodRPM Package installation is very simple, here is the EL6 platform under the mysql-5.6.34 version for example, first, the above Sohu image address to download to the following four MySQL-related software installation
Goal: Create three tables, Student table student (Sid,name,gender), curriculum Course (cid,name), score mark (Mid, Sid, CID, gender);Requires SID, Cid, and mid as the primary key,Student name can only be F or MThe SID CID in Mark is a foreign key,
1, the maximum number of connections exceeded the problem. Mysql:error 1040:too Many connections the number of database connections is not temporary change, the middle of the default 151 login Mysql-uroot-proot set the number of connections sets
The following article is mainly about the creation of MySQL new user, the actual steps to create a new database, and how users can authorize and delete the user's actual operation, as well as the actual operation to modify the password, the
1. Database table operations:
-Start the MySQL server first, open the CMD window in the directory where MySQL is installed, and run MySQL: ' mysql.exe-hlocalhost-p3306-uroot-p123456 ';
-View all databases: show databases; --Create DATABASE
1install MySQL server first download good mysql RPM installation package using RPM command installation: RPM-IVH mysql-server-5.1. the-1. glibc23.i386.rpm command Explanation: I:install V: Show Details H: Show progress bar issue: Display software
MySQL GROUP by statementThe GROUP BY statement groups The result set based on one or more columns.On the grouped columns we can use COUNT, SUM, AVG, and so on.GROUP by syntaxSELECT column_name, Function (column_name) from Table_namewhere column_name
1. Create MySQL user, MySQL group.# useradd-s/bin/nologin-m MySQLSee if the creation was successful.# ID MySQL2. The MySQL-speaking binary package is extracted to the/usr/local/directory.# cd/usr/local/# TAR-ZXVF
1, the operation of the library1 mysql> show Databases; #查看所有的库 2 mysql>Selectdatabase(); #查看当前所在的库 3 mysql> use db1; #切换到db1库 4 mysql>dropdatabase db1; #删除db1库2, the operation of the table1Mysql>
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
Open the server this morning. 13W a Trojan horse. was successfully exploded 2 times, 3 holes. The database was deleted. It was a sad experience.Fortunately before there was a backup, the server also upgraded the security mechanism, but the backup
MySQL version: 5.6.38Although the instance was created with Utf-8 's utf8_general_ci, there are still garbled characters when saving Chinese with other programs.Document A workable solution that modifies the character set of the database.Due to the
Select T1.id,t2.idfrom T1Left JOIN T2 on t1.id = T2.id and t1.id>1 and t2.id<>3In the left join of MySQL the condition is placed behind and is different in the back of the Where;1. On the back only for the T2 table filter, so the above t1.id>1
Mysql common operations, table connection query, addition, deletion, modification, and query, mysql addition and DeletionI. Table creation 1. Simplest table CreationCreate table user (Id int,Name char (20 ),Age int);2. Create a table with a primary
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)
MySQL Schema and data type optimization, mysqlschema
Select the Optimized Data Type:
1. Smaller ones are usually better:
In general, try to use the minimum data type that can properly store data. Smaller data types are usually faster, because they
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.