1. To optimize the query, avoid full-table scanning as far as possible, and first consider establishing an index on the columns involved in the Where and order by.2. Try to avoid using the! = or <> operator in the WHERE clause, or discard the engine
Create a groupList the number of products per vendorSELECT COUNT (* as vend_num from ProductsGROUP by vend_id2--Filter GroupingShow customers with more than two ordersSELECT COUNT (* as orders from the ordersGROUP by cust_id having COUNT
Article: http://blog.sctux.com/?p=396Now, let me take a look at my surveillance environment.zabbix-3.0.3MySQL-5.6.231. First we want to log in to MySQL and create a user who monitors MySQLGrant replication Client on * * to [e-mail protected] '
MySQL installation: CentOS 7.2 Yum Way to install MySQL 5.7The two servers were as follows:master:192.168.1.100Slave:192.168.1.101Master configuration:Edit/etc/my.cnf File:# slave will do replication based on this log-bin. # # default = 1,
Optimize indexes, SQL statements, analyze slow queries;
Design the database strictly according to the design paradigm of the database;
You can save disk IO by using memcache caching, and placing frequently accessed data in the Memcache cache
MySQL Federated Index DetailedA federated index is also called a composite index. For composite indexes: MySQL left-to-right uses fields from the index, and a query can use only one part of the index, but only the leftmost section. For example, the
Previous wordsFor front-end engineers, the database is not the main skill points, but the basic additions and deletions to the operation still need to understand. Small matches the MySQL database's learning record is organized as
In MySQL database system we modify the user password in a total of three waysThe first type: SET PASSWORD mode# Modify the current login client user password mysql> SET password=password (' 123456789 '); Query OK, 0 rows Affected (0.00 sec) #
View the downloadable version of the MySQL database available on YumYum grep MySQLInstalling the MySQL client Server server via YumYum Install -y mysql-server mysql Mysql-develInstall complete to view the installed versionRpm-qi Mysql-serverAfter
Use mysqldump for mysql backup and mysqldumpmysql backup
Note: Backup files and binary log files cannot be stored on the same disk as mysql.
Node 1
1. Modify the mysql configuration file on node 1 and enable binary log storage.
Here I put the binary
My SQL 1067 error and encoding solution, sql1067
Most of My SQL statements use the green version (extract version) and then register the service for convenience.
However. Configuration files have a headache.
First, configure the mysql environment
Mysql migrates database instances by copying data files, and mysql copies
Mysql migrates a database by copying data files.
-- Windows Environment
Copy the source machine database A to the target machine B:
I first install MySQL on the target
Mysql-3 retrieval data (I), mysql-3 retrieval dataSELECT statement
SELECT to retrieve table data, at least two pieces of information must be provided -------- what to SELECT and where to SELECT.Retrieve a column
SELECT prod_name FROM products;
The
In the Mysql database, tree traversal is implemented through the stored procedure, and mysql Stored Procedure
For tree traversal of multiple levels of menu bar or lower-level departments in the permission system, connect by is available in oracle,
When installing mysql in CentOS, you forget to set the root password and cannot log on. centosmysql
Preface
When mysql was started one day yesterday, the following message is displayed:The server quit without updating PID fileAfter I reinstalled
In-depth exploration of mysql (1)-Introduction to database and mysql installation, from simple to deep mysql
Mysql installation: Since you only have a Linux computer, Let's explain how to install mysql in Linux! In fact, I suggest you directly use
30-minute MySQL Quick Start (illustration) and mysql Quick Start
1. Install MySQL
MySQL download
Http://dev.mysql.com/downloads/mysql/
MySQL version Selection
Custom MySQL feature Installation
Custom Feature Selection
Custom Path Selection
Set
MySQL error 1418 Cause Analysis and Solution, mysql1418
Analysis and Solution to error 1418 in MySQL
Specific error:
When using mysql to create and call stored procedures, functions and triggers, the error code is 1418.
ERROR 1418 (HY000): This
MySQL Command Line
MySQL command line to export the database:
1. Go to the bin folder under the MySQL Directory: directory from cd MySQL to the bin folder
For example, if the command line I entered is cd C: \ Program Files \ MySQL Server 5.5 \
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