MySQL master configuration small Note:
There are four machines: A (10.1.10.28), B (10.1.10.29), C (10.1.10.30), D (10.1.10.31).
After the configuration result: A-c is mainly from, B is a slave,d for C slave.
0) Preparation workAfter installing
Also called the Master from replication, is done through binary log files, note: MySQL database version, two database versions to the same
System environment:
Master server Master ip:192.168.0.88
Slave ip:192.168.0.99 from server
One-way sync
Note
MySQL Open universal query Log general logafter MySQL opens the general log, all the query statements can be read in the main log file in a readable manner, but this will be very large log file, so the default is closed. Sometimes in order to check
1. View character Set related variables
Mysql> Show variables like ' character% ';
+ ———————— –+ ——————————-+
| Variable_name | Value |
+ ———————— –+ ——————————-+
| character_set_client | latin1
MySQL like syntaxthe LIKE operator is used in a WHERE expression to search for the specified content in a matching field, and the syntax is as follows:
Where column like pattern
WHERE column isn't like pattern
When you precede the like
MySQL database power-on error:
Innodb:the log sequence number in Ibdata files does not match
Innodb:the log sequence number in the ib_logfiles!
100224 12:24:20 Innodb:database is not shut down normally!
Innodb:starting crash recovery.
innodb:reading
Change the data type of a column
[SQL]
ALTER TABLE Visitor MODIFY Nam VARCHAR (30);
Append new Column
[SQL]
ALTER TABLE Visitor ADD age INT;
ALTER TABLE Visitor ADD age INT A;
ALTER TABLE Visitor ADD age INT after Nam;
Change the position of a
Recently always to initialize data for this project, make a lot of headaches, and the database ID become more and more, to let the self-increase starting from 1: Then use the following method:
method One : If the previous data is not needed, you
ERROR 1130 (HY000): Host ' localhost ' isn't allowed to connect to this MySQL server www.jb51.net
Reason for the occurrence:
MySQL has only one root user, after modifying the root password, select MD5, and submit it again
Login appears "Host '
The default behavior of timestamp before MySQL 5.6.6:
Timestamp column if the null attribute is not explicitly declared, the default is not NULL. (Other data types, if not declared as NOT NULL, allow null values.) Sets the timestamp column value to
Show profile was donated by Jeremy Cole to the MySQL community version. The default is off, but the session level can turn on this feature. Opening it allows MySQL to collect the resources that are used when executing the statement. For statistical
I. Overview
This article mainly introduces the problem caused by starting the MySQL service error: "error! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid), Incidentally expands some other knowledge points, The
This paper introduces the use of Group_concat functions in MySQL, such as select Group_concat (name).
Group_concat function in MySQL
The complete syntax is as follows:
Group_concat ([DISTINCT] The field to connect [order by Asc/desc sort field]
1. IntroductionIn the Web application architecture, the data persistence layer (usually a relational database) is a key core part that has a very important impact on the performance of the system. MySQL is currently the most used open source
We will inevitably be thoughtless in the process of creating a table, so we later modify the table
ALTER TABLE statements are required to modify tables
Modify Table Name
Copy Code code as follows:
mysql> ALTER TABLE student rename
Show the existing database by showing
Syntactic:
Show DATABASES [like Wild]
If you use the like wild section, the wild string can be a string that uses the SQL "%" and "_" wildcard characters.
Features: Show databases lists the
Sometimes a table or result set contains duplicate records. Sometimes it is allowed, but sometimes it needs to stop repeating records. Sometimes it needs to recognize that duplicate records are removed from the table. This chapter describes how to
Today, watching a Shuiyu said that his MySQL is now very slow. Asked what the situation was. Say one myisam of more than 2 G in a single table. The answer to the real rubbish.
Simple answer: Switch to a strong server. Changing the server is very
First we need to know the following SQL statement to query MySQL database/table related information:
Copy Code code as follows:
Show DATABASES//list MySQL Server database.
Show table [from db_name]//list database datasheet.
Show CREATE
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