The following step-by-step to introduce you to the very detailed, specific details please see below.
First, prepare
Test with two servers:
Master Server:192.0.0.1/linux/mysql 4.1.12Slave Server:192.0.0.2/linux/mysql 4.1.18
Master from the
The MySQL caching mechanism is simply caching SQL text and query results, and if you run the same SQL, the server takes the results directly from the cache without having to parse and execute the SQL. If the table changes, all buffered queries that
MySQL's stored procedures are supported from version 5, so the stored procedures are now available for general use. Share your knowledge and understanding of MySQL stored procedures today.
Some simple calls and grammar rules here is not to repeat,
1. First create a database backup directory:
mkdir backup
CD backup
mkdir mysqlbackup
cd mysqlbackup
2. Create a backup script
VI Mysqlautobackup
3. Scripting:
Filename= ' Date +%y%m%d '
/mysql bin
For security reasons, the database needs to be backed up frequently, or restored. For MySQL, the most convenient way may be to use the phpMyAdmin export, import functionality, but if your database volume is larger, as a WEB application phpMyAdmin
Here are 19 main points of MySQL performance optimization to share with you, learn together.
1, for the query to optimize your queryMost MySQL servers have query caching turned on. This is one of the most effective ways to improve sex, and it is
First of all, some uses of MySQL's distinct keywords:
1. This can be used when count does not duplicate records, such as SELECT COUNT (DISTINCT ID) from tablename , or how many records with different IDs in the Talbebname table are counted.
2, you
the use of having
The HAVING clause allows us to sift through the various data in the group, where the words filter the records before aggregation, that is, before the group by and the having words. The HAVING clause filters the group records after
When we run a MySQL client to connect to the MySQL server, it is not appropriate to specify our password in a way that is exposed to other users. There are four ways we can enter passwords, each of which has a certain risk. Here are the following
When you use MySQL (show tables), you sometimes need to see information about tables and fields (whether the table and a field exist, etc.) ~ ~ and PHP provides such related functions as: Mysql_list_dbs (), Mysql_list_fields (), But the
Mysqladmin is an important client of MySQL, the most common is to use it to close the database, in addition to this command can also understand the running state of MySQL, process information, process killing and so on. This article describes how to
There is a statistical need for IP classification statistics, MySQL provides Inet_aton () and Inet_ntoa () function process processing.The official manual can be viewed in detail.
Inet_aton (expr)Gives a point address representation of a network
According to the official manual recommended InnoDB buffer Hit ratios calculation is:
100-((ireads/ireadrequests) *100)
ireads:mysql->status->innodb_buffer_pool_reads
iReadRequests: Mysql->status->innodb_buffer_pool_read_requests
As we all know, in MySQL, if direct order by RAND (), the efficiency is very poor, because it will be executed multiple times. In fact, if the equivalent query is also in RAND (), let's take a look at the different execution plans and execution time
This time, let's take a look at the impact of index, submit frequency on InnoDB table write speed, and see what needs to be noted.
Let's just say a few conclusions:
1, about the impact of the index on the write speed:A, if there is a self-added
Environment:
Pc:ubuntu 10.10 192.168.1.112 (master) 192.168.10.245 (slave)Mysql:5.1.49-1ubuntu8.1-logDatabase test already exists in master
First Modify MySQL configuration file:/etc/mysql/my.cnf[Master]
#author: Zhxia
Copy Code code as
MySQL remote connection cannot open solution
1, Change Table method .
Please use MySQL management tools, such as: SQLyog Enterprise, navicate MySQL
Your account may not be allowed to log in remotely, only in localhost. This time, as long as the
This example describes how MySQL uses temporary tables to speed up queries. Share to everyone for your reference. The specific analysis is as follows:
With a MySQL temp table, sometimes you can speed up the query, and here's a detailed description
If you want to partition on a table that has already been built, MySQL prompts for an error if you add the partition using alter:
Copy Code code as follows:
ERROR 1505 Partition Management on a not partitioned the table is not
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