Database stored ProceduresDrop PROCEDURE Generate_serial_number; CREATE PROCEDURE generate_serial_number (in Param_key varchar (a), in Param_orgid Int., out result int) begin START TRAN saction; Select number+1 into result from Sys_serial_number
Objective
Because of the recent use of MySQL database, but the company's server and business is limited, so only a single MySQL. So, the problem is obvious, if this MySQL is broken, it will affect the entire company's business, so consider
A junction is the most important operation that can be performed with a select of SQL. In order to improve the effectiveness of storage and avoid data redundancy, it is often possible to store the associated data in several tables, so how can you
For a table that has already been created, although the data type of the field determines the type of data that can be stored, the data stored in the table is not checked for legality.MySQL-Supported integrity constraints:
The value of the
Under the Linux system, the following are the methods for viewing the compiler parameters of Nginx, Apache, MySQL, and PHP.1, nginx compilation parameters:Your_nginx_dir/sbin/nginx-v2, Apache compilation parameters:Cat
Deal1, query whether the lock tableShow OPEN TABLES where In_use > 0;Viewing transactions that are being lockedSELECT * from INFORMATION_SCHEMA. Innodb_locks;View transactions waiting for a lockSELECT * from INFORMATION_SCHEMA. Innodb_lock_waits;2.
Note: In a production environment, you need to have dirty data in the database, clear the table data, and preserve the data structure.Steps:With tools SQLyogI. Export the database structure650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/86
The project is based on: THINKCMF, the new demand is the number of articles in each column statisticsSQL is simple, grouping by Category ID First, then counting the number of different article states by caseSELECTT.NAME,T.PARENT,T.TERM_ID,Count(1)
1. LoginMysql-uroot-hlocalhost-pEnter Password: * * *2. View all libraries, use corresponding libraries, create a libraryshow databases;Use SYS;Create DATABASE Database;3. View the tableShow tables;4. Create a tableCREATE TABLE student ( int
Originally thought directly to the data folder for each database corresponding folder to the new MySQL Data folder can be, it is not.There are several problems with this:1. If you use the engine's table, you also need to copy the Ibdata file, and
View MySQL Run processMysql>show processlist;To view the InnoDB engine operating conditions:Mysql>show engine InnoDB Status\gTo view MySQL parameter conditions:mysql>show [Global] variables like '%innodb% ';To view MySQL running status:mysql>show
Syntax structure:Mysql_connect (Servername,username,password);
Parameters
Description
ServerName
Optional. Specifies the server to connect to. The default is "localhost:3306".
Username
1 , the system has no self-brought MySQL : Yum List installed | grep mysql , If there is already, execute the command yum-y remove mysql-libs.x86_64 Uninstall the MySQL that is already installed . http://dev.mysql.com/downloads/mysql/ 2 , first
1. When using the set in (X,x ... The parameters can be single or multiple when they are single:Findbyids (list IDs), or Findbyids (Long [] IDs)SelectFrom Jria where ID inOpen= "(" separator= "," close= ")" >#{item}collection= "Array" when an array
Create a new test table in the database T_user, containing three fields ' ID ', ' name ', ' Grilfriend ', the field is easy to see, this is the record of a person's girlfriend's table, note here the ' firlfriend ' field can be a multi-person name,
In the previous article, when extracting SQL statements from the log, I ran into a sentence of SQL that was not extracted across n rows. Later on the web search for two shells:Sed-n '/^insert/,/;/p ' log.sql > Log_insert.sqlSed-n '/^update/,/;/p '
SQL statements are used to modify, add, delete, and modify attributes (MySql) and sqlmysql
Method 1:
Directly (manually) modify the database name, database table name, database column name, and column attribute
Method 2:
Use SQL statements to
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