Frequently used functions$link =mysql_connect ("Database Address", "User name", "password");//LINK Databasemysql_query ("Set names file encoding name");//Set link encoding//This is a common setup methodMysql_set_charset ("coded name")//Set link
CentOS build MysqlMMM high availability architecture CentOS
Environment
CentOS
For Mysql 5.1
Prerequisites
EPEL is installed. for detailed installation steps, see
Http://blog.csdn.net/robinsonmhj/article/details/36184863
Machine ListMachine IP
How to query slow SQL statements in MySQL
1. query logs
(1) enabling MySQL slow query in Windows
In Windows, the configuration file of MySQL is usually my. ini. find [mysqld] and add
The code is as follows:
Log-slow-queries =
Summary of regular MySQL analysis and table optimization methods
Periodic Analysis Table
ANALYZE [LOCAL | NO_WRITE_TO_BINLOG] TABLE tbl_name [, tbl_name]
This statement is used to analyze and store the table's keyword distribution. During the
Usage of visual charts in MySQL and tips for multi-table INNERJOIN
Create View
SQL code
CREATE VIEW view_name AS SELECT t1.xxx, t2.xxx, t3.xxx FROM (table1 t1 INNER JOIN table2 t2 ON t1.fid = t2.fid) INNER JOIN table3 t3 ON t1.mid = t3.mid;
Three
In mysql, we can use the DAYOFWEEK and WEEKDAY functions to obtain the week of the specified date. The difference is that the weekly index obtained by DAYOFWEEK starts with 1, and the weekly index obtained by WEEKDAY starts with 0.
DAYOFWEEK (date)
Original works of Lin Bingwen Evankaka. For more information, see http: blogcsdnnetevankaka Lin Bingwen Evankaka. Reprinted please indicate the source http://blog.csdn.net/evankaka
MySQL database provides a wide range of functions. MySQL functions
I am a distributed database cluster middleware developer. I have been developing for more than a year. today I want to summarize some of the things I know, provide some reference to developers who have recently come to this field. Life is not easy,
Andord (mid (version (),) 51 explanation 1: confirm that the database version 51 is ASCII code 3 is correct. if the 40 is incorrect, and ord (mid (version (), 1, 1)> 51
Interpretation 1: confirm that the database version 51 is ASCII code 3 is
My website has not been on for a long time. I want to open it and find that it cannot be opened, so I found a series of reasons. Vps is not working. dns resolution is faulty. after a domain name has a problem and a simple troubleshooting, my vps
This article describes seven MySQL index types. Index fields in database tables can greatly improve the query speed. By making good use of these indexes, you can make MySQL Query and operation more efficient.
I. INTRODUCTION to index types
Mysql
MySQL contains the [client] and [mysqld] sections in the configuration file, and MySQL has its own client commands and server-side commands. The following is a brief introduction. ① If the administrator sets a logon password for the MySQL login user
Brief differences between storage engines: 1. Storage Engines 2. differences between myisam and innodb 1. storage engines 1. what is a storage engine in general is an example of how data is stored and managed: bicycle administrators in a certain
This article mainly introduces the triggers in MySQL, including using triggers to add, update, and delete users. if you need them, you can refer to the following: in many cases, it is better to understand what you do. The solution should be designed
This article describes how to use the HAVING statement directly in MySQL without GROUPBY, and how to use the MAX and MIN functions in this case, if you need a table, you can refer to a response from someone who gave me today. The Table id is the
This article mainly introduces a simple tutorial on data import and recovery in MySQL, mainly using the LOADDATA statement, for more information about how to load MySQL data to files backed up from the MySQL database, see the following two simple
This article mainly introduces the sub-query operations in MySQL, and provides specific code examples. if you need them, you can refer to the following preparations:
Create a test database TestDB;
create database TestDB;
Create Test tables
This article describes how to use MySQL in Docker and the simple internal setup steps. if you need it, refer to the virtualization technology mentioned below. I am a linuxContainer (LXC). But with the increasing popularity of Docker technology, I
This article mainly introduces the errors that occur when the savepoint statement in MySQL is used. The problems that occur when the string is eare also submitted as a MySQL bug, if you need a friend, you can refer to the case to help your
Do you need to remember many mysql commands when installing, managing, and using mysql. In addition, for beginners, there are not many commands that do not know how to apply them. for veterans, many commands have long time to forget the specific
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