In MySQL, you can use the explain command to see how a query statement is executed, using a method Example: Explain + query statementExample: Explain select * FROM User_infoA few important field descriptions:Table: Which data table is associated
MySQL It provides a variety of database storage engines, the storage engine responsible for MySQL storage and retrieval of data database. Different storage engines have different characteristics, and it is necessary to convert the storage engine of
Brief introductionMySQL is an open source small relational database management system, the developer of the Swedish MySQL AB company. MySQL is now widely used in small and medium-sized websites on the internet. Because of its small size, fast speed,
1. Logical backup
A logical backup in MySQL is to back up the data in the database as a text file, and this text file can be viewed and edited mysqldump[[Email protected]~]# mysqldumpusage:mysqldump [OPTIONS] database [tables]OR mysqldump
1. Numeric type
Int ( TINYINT, SMALLINT, Mediumint,int,bigint )The default is: signedunsigned unsigned, cannot take negative numbers The zerofill modifier Specifies a value of 0 (not a space) that can be used to really complement the output. Use
Based on the Ubuntu/debian system, it is easy to install MySQL using apt.InstallationTo install MySQL via apt, just one command:Apt-get Install Mysql-serverIf the installation is unsuccessful, try it as prompted:
The system has installed
Received SMS alarm, is a R710 hard disk (Raid5 8 block) Bad 1, contact room replacement hard disk, because of the slot problem changed a few new hard drive after the bright yellow light, and the original 1 hard disk after the change, bright green,
Primary master SynchronizationPrepare two hosts first, all installed on MySQL.Assume that the IP of a host is: 192.168.216.10The IP of Host B is: 192.168.216.11Goal: Synchronize all tables in the test libraryFirst Step: Configuration fileHost a
Date type
Storage space
Date format
Date Range
Datetime
8 bytes
YYYY-MM-DD HH:MM:SS
1000-01-01 00:00:00 ~ 9999-12-31 23:59:59
Timestamp
4 bytes
YYYY-MM-DD HH:MM:SS
1970-01-01
A few days ago to the company's developers virtual out a MySQL server, using SSH login after show databases, show tables are quick, but colleagues use the connection tool to connect dataLibraries need to wait a few seconds, with the program to
Method 1:From book Select Greatest (@found: =-1, user_id) as user_id, ' user ' as which_tbl from user where user_id = 1union allselect user _id as user_id, ' user_archive ' as which_tbl from user_archive where user_id = 1 and @found is nullunion
1. Single Book Storage operationSimple Insert operation Note that the uniqueness of the primary key means that you cannot have a numbered bookThe client can check the existence of the book before inserting it and give it back to the user of course
Modify the My.cnf file (typically in/etc/my.cnf), add a row skip-grant-tables in the [Mysqld] node (do not enable the authorization table when starting MySQL), and then restart the MySQL server (/etc/init.d/mysqld RestartAfter restarting, use MySQL
Install 2 Windows Server servers, install MySQL Separately, configure environment variables, complete the installation confirmation in the CMD window can use the MySQL command
Create a Sync account on the master server to ensure that the slave
7.1 viewsViews enable programmers to only care about specific data that interests them and the specific tasks they are responsible for. Improves the security of data in the database. The features of the view are as follows:
The columns of
A website, the most important is the data above it, but when the database hangs one day, will affect the normal operation of the entire site, MySQL master-slave replication can be a good solution to this problem, MySQL master-slave replication is,
1. Use the explain statement to see if the index is used:EXPLAIN SELECT * from tb1_name WHERE 1 = 02. The WHERE clause below illustrates how this works. In the first row, the optimizer simplifies expression 4/2 to a value of 2, and then uses the
9.1 Inserting data records1. Insert full or partial data records:INSERT into table_name (field1,field2,field3,... fieldn) VALUES (value1,value2,value3,... Valuen);Field parameters (field1,field2,field3,... fieldn) can be omitted when inserting
Master-slave replicationBuild a MySQL server environment where the primary server IP address is 192.168.100.9, and the server IP address is 192.168. 100.5.Start remote permissions on the primary server, and the server can telnet to the primary
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