PHP looks very simple, and a beginner can start writing functions in a few hours. But it takes time and experience to build a stable, reliable database. Here are some of these experiences, not only MySQL, but also other databases can be referenced.
Set first: Set GLOBAL log_bin_trust_function_creators = 1;
1. Function Func_splitstringtotal: Split the string in the specified way and calculate the total number of cells
Copy Code code as follows:
DELIMITER $$
CREATE FUNCTION
MySQL table alias (alias)SQL Table AliasIn SQL statements, you can specify an alias (alias) for the Table name and field (column) names, which are SQL standard syntax, and are supported by almost all database systems. specified by keyword as.Table
Update updatesthe update SET syntax is used to modify data in the Update data table.Grammar:
UPDATE tb_name SET column1 = New_value1,column2 = New_value2,... WHERE definition
This syntax updates the value of Column1 in a record in the
To create the Mysql_order_by_test datasheet by following the table structure below, let's use the example 1.1 to tell you the MySQL order by usage.
ORDER BY UID ASC
Query the data according to the UID positive order, that is, by the UID from small
Unconsciously played two years of MySQL, found that a lot of people say that MySQL compared to Oracle, the optimizer does a poor job, in fact, in a way, indeed, But after all, MySQL only to 5.7 version, Oracle has developed to 12c, today I looked at
First of all, MySQL's character set problem. Windows can be modified by modifying the My.ini within the
Default-character-set=utf8 //client's default character set
Enter in the MySQL client tool
Shows the following
first, the concept
The MySQL cluster uses a series of disk Data objects to implement the disks table.
Tablespaces: Serves as a container for other disk Data objects.
Undo Log Files: The information that is required to store transactions for
TIMESTAMP setting defaults is default Current_timestamp
TIMESTAMP settings update automatically with table changes is on update current_timestamp
But because
There can be at most one field set in a table Current_timestamp
It is not possible to set
Common functions for MySQL stored procedures
A. String classCHARSET (str)//return string character setCONCAT (string2 [,...])//connection stringINSTR (string, substring)//Returns the position that substring first appeared in string and does not
In MySQL, a table with the InnoDB engine type supports foreign key constraints.Use conditions for foreign keys:1. Two tables must be INNODB tables, MyISAM table temporarily does not support foreign keys (it is said that future versions may be
How do you modify the root password in the MySQL database? Here's a summary of some of the ways to modify the root user password
1: Using the Set Password statement to modify
Mysql> Select User ();
+----------------+
| user () |
+----------
MySQL can perform operations on data in a table, such as age by birth date, etc.
The operators include the four classes: the arithmetic, comparison, logical, and bitwise operators
Arithmetic operatorsAdd, subtract, multiply operations
Copy
#!/bin/bash #this is a script of MySQL backup if [!-d/mydata/data1/backup]; then mkdir/mydata/data1/backup fi CD
/mydata/data1/backup file=$ (find.-type f-mtime-7 | grep. *all.sql) #查找7天内是否有备份的文件 echo $file if [-Z $file]; then echo "Backup all
Value function abs (x) and pi pi functions ()
Copy Code code as follows:
Mysql> SELECT ABS (0.5), ABS ( -0.5), PI ();
+----------+-----------+----------+
| ABS (0.5) | ABS (-0.5) | PI () |
+----------+-----------+----------+
|
The general process of fault detection and correction for a table is as follows:
Check for errors in the table. If the table checks through, complete the task, or you must fix the database table that is wrong.
Copy the table files before starting
MySQL Import SQL script error: 2006-mysql server has gone away
To some small script that rarely complains, but recently imported a 10+m SQL script, but repeated the error:
Error occured at:2014-03-24 11:42:24 line
no.:85
Error
This article looks at a case to see how the MySQL optimizer chooses the index and join order. Table structure and data preparation refer to the last section of this article, "Test environment." The main implementation process of the MySQL optimizer
Three information on MySQL:
Information about the results of the query: This includes the number of records produced by any select,update or DELETE statement.
Table and Database information: This includes information about the structure of
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