Use the following method (navicat is used for MySQL management). Set the values of the following parameters and the following statements can be executed on the MySQL console.
CopyCodeThe Code is as follows: Show variables like '% timeout % ';
Show
Recently, mysql Databases have encountered multiple numeric types, including int, bigint, smallint, and tinyint. The difference between int and smallint is confusing. Today, I searched for the following content on the Internet, and made a
This article introduces how to use the group_concat function in MySQL through examples, such as select group_concat (name ).
Group_concat function in MySQL
The complete syntax is as follows:
Group_concat ([DISTINCT] field to be connected [Order by
Create two user tables, user and user2. The table structure is the same, but the user table uses the InnoDB Storage engine, while the user2 table uses the MyISAM storage engine.
Copy codeThe Code is as follows: -- Table "user" DDL
Create table 'user
The Default value of timestamp is Default CURRENT_TIMESTAMP.
The timestamp is set to automatically update on update CURRENT_TIMESTAMP as the table changes.
HoweverA table can have at most one field set CURRENT_TIMESTAMPYou cannot set DEFAULT
For the sake of security, you need to back up or restore the database frequently. For MySQL, the most convenient method is to use the Export and Import functions of phpMyAdmin. However, if your database is large, phpMyAdmin, a Web application, may
-- Group data by a certain field to get the data of the row with the maximum (small) Value
Copy codeThe Code is as follows :/*
The data is as follows:
Name val memo
A 2 a2 (the second value of)
A 1 a1 -- the first value of
A 3 a3: The third value of
I used to think that there are two bytes to record the length (a small length can also be recorded using one byte), so this problem was boring at the time.
However, some people in the group explained the problem and suddenly found that it was not
Create two test tables and create the unique constraint on the id column.
Mysql> create table test1 (id int, name varchar (5), type int, primary key (id ));
Query OK, 0 rows affected (0.01 sec)
Mysql> create table test2 (id int, name varchar (5),
The following function implements string processing like an array.
I. Use a temporary table as an array
Copy codeThe Code is as follows: create function f_split (@ c varchar (2000), @ split varchar (2 ))
Returns @ t table (col varchar (20
Example: select (a + B) as c from table
Both types are varchar type, but the display is incorrect.
Until concat ()
Concat functions in MySQLThe following example describes how to use the concat function in MySQL, such as select concat ('11', '22', '
Create the mysql_order_by_test data table according to the following table structure. We will use instance to tell you how to use MySQL order.
Order by uid ASCQuery data in the forward order of uid, that is, sort data in ascending order of uidOrder
(1) thoughts on improving database insertion Performance: Try to write Data to the Data File at a time and reduce the checkpoint operation of the database. The following four configuration items are modified:1) set the innodb_flush_log_at_trx_commit
The following describes two sorting implementation methods and implementation diagrams through examples:Assume that two tables, Table A and Table B, have the following structures:Sky @ localhost: example 01:48:21> show create table AG* **************
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:
When you installed Mysql on the machine for the first time, you can access the database anonymously or enter the database as a root without a password. in addition, if you are an administrator, you need to establish and authorize some users, which
Basic Concepts • Character refers to the smallest semantic symbol in human language. For example, 'A' and 'B;• Given a series of characters, each character is assigned a value, which is used to represent the corresponding character. This value is
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. Evolution:
The maximum length of the MySQL database varchar type in versions earlier than 5.0.3 is 255, and its data range can be 0 ~ 255.
In MySQL 5.0.3 and later versions, the length of the varchar data type can reach 65535, that is, 65532
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