Master-slave replication is not more than a server! , one change, the other changes, the content is actually the same!Principle:Operation on the database will generate a file, Binlog (binary file), from the server configuration Relaylog file, used
First, verify that the original host has MySQL installed:here the main thing is to run sudo netstat-tap | grep mysql command to see if there is a MySQL port, if not add sudo, because the permissions cannot be executed smoothly: $ netstat -tap |
The Auto_increment property of the CREATE table setting is automatically set to 0 when the truncate operation is performedHttp://dev.mysql.com/doc/refman/5.0/en/truncate-table.htmlInnoDBfor a table before version 5.0.3, InnoDB processes by deleting
PreparedStatement object Compared to statement object1, the readability and maintainability of the code.2, PreparedStatement can guarantee security (solve SQL injection problem)3, PreparedStatement can improve the performance of the maximum possible:
Recently the company asked to test the performance of the database, went online to check some of the bulk of the code to insert data, found that there are several different usages, inserting the same data time is also differentOther first not to say,
MySQL Import database has 2 methods, a simple method, directly using the Navcat run SQL file, know that your SQL file directly import OK, but I import the error, the reason, now do not know, the second is the CMD import, this method is a bit
1. Download the installation package: Http://mirror.neu.edu.cn/mysql/Downloads/MySQL-5.5/mysql-5.5.40-linux2.6-x86_64.tar.gz 2. Unzip the tar vxzf mysql-5.5.40-linux2.6-x86_64.tar.gz#cd mysql-5.5.40-linux2.6-x86_64MV Mysql-5.5.40-linux2.6-x86_64/usr/
Usually because you have previously installed MySQL uninstallThe following methods are effective for pro-test.This is one of the more practical ways I've seen in the last few days:1. Uninstall MySQL2. Delete the installation directory and data
explain SyntaxEXPLAIN SELECT ... Variant: 1. EXPLAIN EXTENDED SELECT ... "Decompile" The execution plan into a SELECT statement, run show WARNINGS to get the query statement 2 optimized by the MySQL optimizer. EXPLAIN Partitions SELECT ... Explain
Today after work do not know why, MySQL has been unable to start, tossing for a long time so decided to reloadMy local server is Wamp, when the reload, to do data backup, I use the most simple rough backup method, is directly into the MySQL
MySQL wildcard charactersThe pattern match for SQL agrees that you use "_" to match any single character, while "%" matches the random number of characters (containing 0 characters). In MySQL, the default mode of SQL is to ignore uppercase and
MySQLdb is the package used in Python to manipulate the MYSQL DatabaseAddress:http://sourceforge.net/projects/mysql-python/MySQLdbinstallationUnder Windows is the EXE version number of the one-click Installation . linux requires manual
Functions supported by partition in mysql5.1, 5.5, and 5.6
Partition functions supported by mysql5.1
ABS()
CEILING() (see CEILING() and FLOOR())
DAY()
DAYOFMONTH()
DAYOFWEEK()
DAYOFYEAR()
DATEDIFF()
Analysis of mysql replication principles and functions)Replication Principle 1. The master writes data to the binlog. 2. slave enables two threads: I/O thread and SQL thread. 3. The slave I/O thread connects to the master and reads the binlog file
Mysql advanced permission check Principle
You can perform database operations in two steps:
1. Whether the connection is permitted. The connection is based on host, name, and password;
2. Are you authorized to perform CURD;
Illustration:
Where
Mysql database Event scheduling, mysqlevent
The event scheduler in mysql can regularly add, delete, and execute operations on the database, which is equivalent to a temporary trigger in the database. It is the same as the execution plan task in
Path Problems in mysql5.5
The parameters in my. ini are as follows:
Basedir = "C:/Program Files/MySQL Server 6.0 /"
Datadir = "" path for storing the table structure
Innodb_data_home_dir = "" This is the path for storing table data, ibdata1 (for
Mysql advanced cursor
What is a cursor? The select statement may obtain n statements at a time, so the cursor can obtain a record in the select statement at a time. Move down every time one is obtained! Complicated logic can be implemented!
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