there are several declarative forms of error handling: § If any errors (not notFOUND), set L_error to1to continue execution after:DECLARE CONTINUEHANDLER forSQLEXCEPTIONSETL_error=1§ If any errors occur (not notFOUND), executes rollback and
set up a data table//Department tableCreate TableDept (IDint Primary Key, Deptnamevarchar( -))Employee TableCreate TableEmployee (IDint Primary Key, EmpNamevarchar( -), DeptIDint,--Department Name CONSTRAINTEmployee_dept_fkFOREIGN
Recently I have been doing the Order class project, using the transaction. Our database chooses MySQL, the storage engine chooses the INNODB,INNODB to have the good support to the transaction. In this article, we're going to pick up a piece of
PhpConnect to MySQL
PHP 5 and later recommends connecting to MySQL using the following methods:
mysqli Extension ("I" means improved)
PDO (PHP Data Objects)
We used the MySQL extension in early PHP versions. However, this
MySQL tutorial on installation and useFirst, MySQL the download and installationFirst login to MySQL's official website, choose Downloads→windows→mysql installer→windows (x86,32-bit), MSI InstallerAt the time of installation, you may want to
The commands to view the compiler parameters for Nginx, Napache, MySQL, and PHP under Linux are as follows:1, nginx compilation parameters:#/usr/local/nginx/sbin/nginx-v2, Apache compilation parameters:# Cat/usr/local/apache/build/config.nice3, PHP
http://www.orczhou.com/index.php/2012/11/mysql-source-code-data-structure-about-index/This article will try to describe the data structure associated with the MySQL index store. program = data structure + algorithm, understand the data structure,
MysqlBackup and RecoveryBackup
Hot Spares , which is the direct backup to the database running, has no effect on the running database;
Cold , which means to copy the relevant data physical files when the database is stopped (shut down);
The database needs to be built in the previous time line. Because you do not want to back up the database, you intend to clone the database virtual machine directly to a new one, and then configure Master-slave synchronization. I have not done so
(recently in learning MySQL optimization of some problems, the following is a few personal gains, if there is insufficient, please ask!) )Overview: When a table of data is large, such as 200G, it is too large, we only rely on the index is not good,
MySQL indexing principle# #索引目的The goal of the index is to improve the efficiency of the query, you can analogy dictionary, if you want to check the word "MySQL", we definitely need to locate the letter M, and then find the Y letter from the bottom,
# Create student TablesCREATE TABLE student (age int,name varchar) engine MyISAM charset UTF8;INSERT into student values (18, ' small white ');# Create a teacher's table, the structure is identical to the student table structureCreate table teacher
The CentOS7 Yum source does not seem to have MySQL by default. To solve this problem, we need to download the MySQL repo source first.1. Download the MySQL repo source$ wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm2. Install
The Union clause in MySQL does not support the order by solution. The union clause
This example describes how the Union clause in MySQL does not support order. We will share this with you for your reference. The details are as follows:
I know very
MySQL's InnoDB resizing and ibdata1 file slimming solution are completely resolved, innodbibdata1
Innodb expansion of mysqlTo add a data file to a tablespace, you must first close the MySQL database and edit my. cnf file to confirm the actual
Mysql optimization and troubleshooting
First, we will introduce several keywords.
1 show status indicates the current status data of the database
Show [session | global] status session is the statistical result of the current connection. global
Mysql job (sched), mysqlschedulerIntroduction
A job is also called event scheduling. In fact, it is also a time trigger. It can define a time point to execute a specified database command operation.
Syntax
CREATE [DEFINER = {user | CURRENT_USER}]
In MySql, copy the old table structure to the new table, and mysql copies the table structure
# Creating a student table
Create table student (age int, name varchar (32) engine myisam charset utf8;Insert into student values (18, 'xiaobai ');
#
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