SHOW STATUSLog on to MySQL directly under the command line to run the show status command. The query statement is as follows: The same statement also has show variables; and show status is used to view the MySQL running STATUS, which is similar to
Copy codeThe Code is as follows:SELECT a. 'table _ scheme' AS DB_NAME, a. 'table _ name', a. 'table _ ROWS ', a. 'Engine' --, .*FROMInformation_schema. 'tables 'aLeft join information_schema. 'table _ CONSTRAINTS 'BON a. 'table _ name' = B. 'table _
I. Basic ConceptsThe event concept was introduced in MySQL. The event is a time trigger, which is different from triggers event triggering. The event is similar to a linux crontab scheduled task for time triggering. It can be used independently or
Mysql_fetch_array-- Get a row from the result set as an associated array or number array, or both
Description: array mysql_fetch_array (resource result [, int result_type])
Returns the array generated based on the rows obtained from the result set.
1. mysql transactions
In MYSQL, only INNODB Data Tables support transaction processing.
There are two ways to start a transaction:
(1)Use begin, rollback, and commit to implementCopy codeThe Code is as follows:Start a transactionRollback transaction
Copy codeThe Code is as follows:#/Bin/sh# Check whether mysql server provides services normallyMysqladmin-u sky-ppwd-h localhost ping# Obtain the Current Status values of mysqlMysqladmin-u sky-ppwd-h localhost status# Obtain the current connection
A friend was in a hurry: mysql forgot the root password and asked me to help you. I found the information from the Internet because I have never been in touch with mysql.I have already put it into practice! The mysql version is 5.1.The following is
1. When the value of a field needs to be displayed through other word values (record conversion), the following statement can be used:Case Type when '1' then' normal channel 'when' 2' then' high-end channel 'end as TypeWhere "Type" is the field name,
The positioning result is as follows:
Customer environment:Windows server 2003 r2 standard edition sp2Mysql Ver 14.12 Distrib 5.0.18, for Win32 (ia32)In apache 2.2RisingWebshield client 1.08
The problem has been reproduced. It can be optimized. It
1. MySQL support
1.1 MySQL module support
By default, the MySQL module is not included.
The opensipsctlrc file contains the database configuration information. To enable opensips to support mysql databases
It is necessary to support the mysql module.
A one-to-multiple table is usually associated with the primary key of another table. However, there are also some unusual situations, that is, two tables are not joined by the primary key of one of the tables.For example:Copy codeThe Code is as
Fields defining the UNIQUE constraint cannot contain duplicate values. You can define a UNIQUE constraint for one or more fields. Therefore, UNIQUE can be defined at the field or table level, fields with UNIQUE constraints can contain null values.
A subquery is a nested query statement in another query statement.
Query results of the inner query statement, which can provide query conditions for the outer query statement
In certain circumstances, the conditions of one query statement must be
The problem is as follows:The persons table has two fields: id and name.The content in the document persons.txt (tabs are used to separate fields in each line ):1 Bush2 Carter3 BushUse load data local infile into persons.txt "into table persons in
The time format is 2013-03-12.Query the data of the current day:Copy codeThe Code is as follows:SELECT * FROM 'table' WHERE date (time field) = curdate ();Query the current month field:Copy codeThe Code is as follows:SELECT *FROM 'table'WHERE month (
1. Create the path to save the mysql backup file/mysqldata# Mkdir/mysqldata2. Create the/usr/sbin/bakmysql file.# Nano/usr/sbin/bakmysqlInput:Copy codeThe Code is as follows:#! /Bin/shName = 'date + % Y % m % d'Mysqldump -- all-databases-uroot-p
Perform a detailed analysis on mysql Query Cache from five perspectives: Query Cache working principle, how to configure, how to maintain, how to determine the Query Cache performance, and suitable business scenario analysis.
Working Principle
The
1. query help? Contents2. Use the merged hash value to separate BLOB or TEXT3. Number of points used for currency (decimal or numberic)4. SQL _mode?5. order by rand () limit 1000;6. Optimize show status like 'com' Com_select Com_insert and so on to
An error is reported when mysql statements are used today. The statement is as follows:SQL codeCopy codeThe Code is as follows:SELECT sapcle FROM SellEnterpriseBaseInfor sebie, SellEnterpriseBaseInforVer sebive, sellapplyperpolicangelist sapcleWHERE
In Navicat for MySQL, PostgreSQL and OracleThe error occurs because the mysql account does not have sufficient permissions to connect to the remote mysql server.After mysql is installed, only "localhost" connections are allowed by default. Therefore,
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