This is often the case when designing databases, for example:
There isArticleThere is a type field in the table, which stores the article type, including 1 headlines, 2 recommendations, 3 hotspots, 4 images and texts..., 12, 13, etc.
There is an
The following excerpt describes utf8_unicode_ci and utf8_general_ci In the MySQL 5.1 Chinese manual:
Currently, utf8_unicode_ci rules only support Unicode rules.Algorithm. Some characters are not supported. In addition, the combination of tags
Drop table if exists [TEMP_TABLE_NAME];
Create temporary table [TEMP_TABLE_NAME] select col1, col2,... from [TABLE_NAME];
Alter table [TEMP_TABLE_NAME] add unique idx_col1 (col1 );
This warning problem occurs multiple times during the preceding
There are three primary key generation methods:
1. Automatic database generation
Ii. GUID
Iii. Development and Creation
Strictly speaking, these three production methods have certain intersections, and their positioning methods will be explained
This error occurs in the past few days.
I still don't know if these values are correct solutions. Post it first.
If I haven't updated it for a while, please refer to it later.
Out of memory (Needed 16777224 bytes) Error resolution
Look at the manual:
1. Mysql errono 1005: The primary and Foreign keys are not completely consistentCheck the following points:
A. Does the field exist?B. Whether the types are consistent (pay attention to the unsigned and powerdesign generation issues)C. Database
I am using a MYSQL database operated by MySQLdb. Let's take a simple example:
Copy codeThe Code is as follows: import MySQLdb
Try:Conn = MySQLdb. connect (host = 'localhost', user = 'root', passwd = 'root', db = 'test', port = 3306)Cur = conn.
Mind Map
Click an image to view the large image.
IntroductionSituation: If your table structure is poorly designed or your index design is poor, please optimize your table structure design and assign appropriate indexes so that your query
You have to worry about using Vps, and backup is also required. Backup services in Linode are charged, with a monthly fee of $5. Instead of spending the $5, it's better to get yourself full of clothing and food. The Dropbox is installed for the
Unsigned is a non-negative number. You can use this type to increase the data length!
For example, if the maximum value of tinyint is 127, the maximum value of tinyint unsigned is 127*2.
The unsigned attribute is only for integer type, while the
A MySQL table can be considered as a queue, with each row being an element. Each query gets the first row that meets a condition, and deletes it from the table or changes its status so that it will not be obtained in the next query. Without
Locking also reduces the overall time for multi-connection testing, although the maximum wait time for them to wait for locking will increase. For example:
Copy codeThe Code is as follows: Connection 1 does 1000 inserts
Connections 2, 3, and 4 do 1
In fact, this statement is not completely correct. First, the key value of query_cache in mysql is not a simple query, but a query with databasename and flag. This can be seen from the source code. I will not describe it here, but I will analyze it
MySQL has been installed on the two servers, which are all packaged in rpm and can be used properly.
To avoid unnecessary troubles, the MySQL versions of the master and slave servers should be consistent as much as possible;
Environment: 192.168.0.1
1. database/table sharding
Obviously, the unlimited growth of a primary table (that is, a very important table, such as a user table) will inevitably seriously affect performance. Database sharding and table sharding are a good solution, this is
Syntax format:
EXPLAIN tbl_name
Or:
Explain select select_options
The EXPLAIN statement can be used as a synonym for DESCRIBE, or used to obtain information about the SELECT statement to be executed by MySQL.
The EXPLAIN tbl_name syntax is the same
Apache server optimization, PHP optimization, and Mysql Optimization
For program developers, the two most popular backend databases are MySQL and SQL Server. The most basic similarity between the two is data storage and query system. If you want to
Copy codeThe Code is as follows: delimiter |
Drop function if exists IS_MOBILE |Create function IS_MOBILE (x VARCHAR (255) returns tinyint (1)BEGINDECLARE result TINYINT (1) DEFAULT 0;SET x = LCASE (x );If right (x, 4) = '.mp4 'THENSET result = 1;
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