1. Sometimes we may need to record our operation on MySQL, when we are able to use the MySQL tee command1) The first case is to use tee when linking to the database>mysql-u root-p--tee=c:\log.txt//Note there is no need to add an argument to the
In a MySQL replication environment, we usually only judge the latency of the slave based on the value of the seconds_behind_master . This is acceptable in most cases, but is not accurate enough and should be considered for more factors.First, let's
Data structure optimizationOne, select the format of the data typeThe choice of data type, focusing on the appropriate two words, how to determine whether the selected data type is appropriate?1. Use the smallest data type that can save your data.2,
MySQL is currently the latest version of 5.7.x, where the MySQL version installed is stable 5.6. Version 29, and version 5.7 of the installation process is not the same, here on the CentOS 7.2 system deployment process is as followsFirst, open the
Explain execution planAbout MySQL tuning:
Find the problem first (slow query, profile)
For using indexes and not using indexes, learn that indexes can quickly find data
Understanding what an index is (an index is an ordered, fast-looking
A B database installation Just don't say it.Start A B Databaseexecute on A B databaseGrant Replication Slave on * * to ' repl ' @ ' 127.0.0.1 ' identified by ' 123456 ';Link DatabaseChange a Host my.cnf ConfigurationLog-bin=mysql-bin# Binary Logging
Environment: MySQL Sever 5.1 + MySQL command line toolProblem: MySQL command line loginSolve:command-line logon syntax:Mysql–u user name [–h host name or IP address]–p passwordNote: The user name is the user you logged in, the hostname or IP address
Binlog file record format statement, row, rixed three kinds, before 5.7 by default is statement mode, to 5.7 starts by default to row mode.Statement is the statement mode, Binlog record all the statements to make changes to the data, to see Binlog
[[email protected] ~]# mysqladmin-uroot password ' 123456 ' set a password for MySQL[[email protected] ~]# mysqladmin-uroot password ' 123456 ' local login MySQLIf we now have the MySQL password forgotten, reset it now.[[email protected] ~]# vim/etc/
Run: Python If the error indicates that the system is not mounted python or you can bypass the installation python stepInstall PythonDownload wget http://python.org/ftp/python/2.7/Python-2.7.tar.bz2TAR-JXVF python-2.7.tar.bz2CD
The master-slave is the simplest single master-slave copy (i.e., a master and a slave. No matter what the engine backup and multi-Slave, the basic topology diagram for this master-slave structure is seen below:Establishing a primary master-slave
User management mysql>use MySQL; view mysql> select Host,user,password from user ; creating mysql> Create user zx_ Root identified by ' xxxxx '; //identified by will use plaintext password encryption as a hash value to store modifications
Sometimes forget the root password of MySQL, how to do?At this time, we can modify the MY.CNF, add the way to start without checking permissions, then modify the root, and finally restart the MySQL database.(1) Service MySQL stop[[Email protected]
Database subquery, database subquerySubquery
A select statement also contains another select statement, in which the select statement is called a subquery.
Subqueries can be divided into the following categories based on the position where select
Various engines in MySQLThe storage engine in the database is actually used to set the tables that use the engine. What storage engine is set for the tables in the database, this table has different effects in terms of data storage, data update,
MySQLMerge storage engine and mysqlmerge Storage
The MERGE storage engine treats a set of MyISAM data tables as a logical unit so that we can query them at the same time. The MyISAM data table members that constitute a MERGE data table structure
CUBRID Study Notes 27 Data Type 4, cubrid Study Notes
Range comparisonComparison between numbers and strings
The string is converted to double.
SELECT I FROM t WHERE I
I
==================
1
2
3
4Comparison of string and date and time
Convert
MySQL series: Database Design
Preface
Here we will re-pick up the database design knowledge that we were not very familiar with before and make a simple sorting of knowledge. Previously, I thought that database design is nothing more than creating a
Secure Mysql binlog deletion and mysqlbinlog Deletion
Introduction:
If you have set up master-slave synchronization for Mysql or enabled log-bin for the database, a large number of log files will be generated in the data directory of your database
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