Install MySQLsudo apt-get install Mysql-serverThis should be very simple, and I think everyone in the installation is not too much problem, so it is not much to say, the following we talk about configuration.Configure MySQLNote that the MySQL
We often encounter the problem of using random numbers, and here is a way to solve a random number.When constructing the test data, we need to insert random data into the test table. The method of constructing the test data is as follows, only the
Internet companies generally choose MySQL, which is widely used in the Internet, but have been using Microsoft's stuff, including databases (MS SQL Server).This is not the thought of switching databases so easy, but there are some details to
Clear Table DataTRUNCATE table ' name ';Shrink table Space table ' name ';Note: This action is only valid for tables that have a separate tablespace, and is often used to perform the removal of large amounts of table data because the table space
1. Add Default-character-set=utf8 to the [client] field as follows:[client]port = 3306socket = /var/lib/mysql/mysql.sockdefault-character-set=utf82. Add Character-set-server=utf8 to the [mysqld] field as follows:[mysqld]port = 3306socket =
Knowledge Preparation:1. What is the query-cache of MySQL?MySQL can cache the execution of the SELECT statement and the result set corresponding to the SELECT statement, and return the result directly the next time the same SELECT statement is
1. Copy the referenced table:CREATE TABLE clone_product_1 like product_1;INSERT into Clone_product_1 SELECT * from product_1;2. Copy the reference table:1. Get the complete structure of the data table.2. Modify the data table name of the SQL
Three tables, fields and data are as follows, and for simplicity all is shaping:zzz_repair:== Repair Order Form: order number, Provincezzz_repair_goods:== "Maintenance commodity table, order number, product name, number of goodsZzz_sell: = = "Sales
Relational database concepts:1. What is a relational database? Relationship Type database: A database built on a relational model (mathematical model)Relational model: A model that is so-called based on relationships.The relational model consists
Advanced queries in MySQLPreviously learned query syntax: Select field name from table name where conditionIn fact, the syntax of the query varies a lot:1. Select can query an expression, which is an operator + operand.For example 1 + 1 2 * 3 2-1+5*9
For example:There is an article table with a Type field, which stores the article type, there are 1 headlines, 2 recommendations, 3 hotspots, 4 graphics ... 1,12,13 and so on.Now there is an article he is a headline, but also hot, or graphic,The
1. Integral type
MySQL data type
Meaning (Signed)
tinyint (m)
1 byte range ( -128~127)
smallint (m)
2 byte range ( -32768~32767)
Mediumint (M)
3 byte range ( -8388608~83
Recently encountered in the work of the database server generated a lot of read and write queue problems, and asked everyone to start optimizing our SQL statements.The following is the SQL statement that queries the Code field in the
Why optimize the storage of IP addresses?Many times, when we operate MySQL, and to be overly concerned about how to optimize the content of MySQL storage, improve access speed, but do any program design on the basis of functional implementation to
The 5.7 version of MySQL has a slightly different installation than the previous version, which recordsClick here to download to MySQL and unzip it to a folderand modify the My-default.ini file, as follows:Then create an empty data folder under the
Mysql-SQL advanced application, mysql-SQL applicationAdvanced SQL languageTypical operations
Order
- select * from play_list order by createtime;- select * from play_list order by bookedcount desc,createtime asc;The order by statement is used to
MySQL replication error Last_ SQL _Errno: 1146 solution, last_ SQL _errno1146
Background: When we use the Tablespace transcation solution for data migration or splitting, we may encounter an error in slave database replication and report: Last_ SQL _
Usage and note of the Mysql row number () sorting function, mysqlrow
Although it is not used much, it is also necessary to write the statement development function in mysql. In SQL server, I am used to using the row_number () function for sorting,
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