Today's production environment MySQL encountered a problem, an application in the production environment is a distinction between uppercase, but MySQL is not case-insensitive, this is the pit dad, the data found to have two, the program error said
Recently, due to the need for work, we began to focus on the relative optimization of select query statements for MySQL databases.Because of the actual project involved, it is found that when the data volume of MySQL table reaches millions, the
Under Window1. Export the entire databaseMysqldump-u user name-p database name > exported file nameMysqldump-u dbuser-p dbname > Dbname.sql2. Export a tableMysqldump-u user name-P database name Table name > exported file nameMysqldump-u dbuser-p
MySQL Add, delete, check, change operation command:First, modify MySQL Database passwordFormat: Mysqladmin-u username-P Old password password new password.Second, viewSee how many databases: Notice the back with S#查看SHOW DATABASES;#查看表USE blog; SHOW
Introduction: MySQL Join connection, summed up under a total of the following several common ways, with a picture more intuitive to display:1.inner join: That is, the portion of B in the query graph, which is the data shared by both A and B tables,
Environment Preparation:Deploy a master one from two servers, achieve master-slave replication, the main library to open Binlog, the main library and the Server-id from the library to be differentMain Library:[Email protected] ~]# hostname-i10.0.0.51
Requirements Description:Case background: In the course of bank transfer, accidents are unavoidable. To avoid unnecessary losses caused by an accident, the transaction is handled in the same way:A account has an existing balance of $1000 and a
MySQL's master-slave is an asynchronous replication process, which is actually a process of copying data from the master to the slave end. The entire replication process between Master and Slave is performed primarily by three threads, of which two
A subquery is the nesting of another query statement in a query statement.The query part outside the subquery is referred to as an external query.The subquery must contain parentheses.Any, in, someThe Any keyword must be used with a comparison
#mysql basic Commands#1, view all databases#show databases;#2, creating a database#create database dbname;#3, using the database#use dbname;#4, view the tables in the library#show tables;#5, creating data tables#filid int PRIMARY Key
The steps are as follows:1. Modify Master server Master:#vi/etc/my.cnf[Mysqld]Log-bin=MySQL-bin//[must] enable binary loggingserver-id=222//[must] server unique ID, default is 1, usually take IP last paragraph2. Modify the slave from the
MySQL allows remote access1. Initialize root passwordGo to MySQL DatabaseMysql>update user Set Password=password (' 123456 ') where user= ' root ';2, allow MySQL remote access, you can use the following three ways:(1) Change the table.Mysql-u
Convert date format to int using Unix_timestamp ()For example:Select Now (), Unix_timestamp (now ());Now () | Unix_timestamp (now ())2014-11-28 09:54:43 | 1417139683Use From_unixtime () to convert a date from an int type timestampFor example:Select
1. Using the mysqldump commandBackup: Mysqldump-u username-p dbname table1 table2 ...> backupname.sqlRestore: Mysql-u username-p [dbname]Mysqldump-u root-p123456MySQL user servers> Backup.sql//put the library under MySQL table user, table servers
Explain usage of mysql query statement analysis
Explain shows how mysql uses indexes to process select statements and connect tables. It can help you select better indexes and write more optimized query statements.
You can use the explain statement
Tips and notes for using mysql indexes, and tips for using mysql IndexesI. Functions of Indexes
In general application systems, the read/write ratio is around, and insert operations and general update operations rarely encounter performance problems.
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