It is very important to specify the encoding when creating a mysql database. Many developers use the default encoding, which is difficult to prevent. Coding databases can avoid garbled characters caused by import and export.Webpage data is generally
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
This is what I write when I write a table that imports data from one database to another.Copy codeThe Code is as follows:Header ("Content-type: text/html; charset = UTF-8 ");
$ Conn = mysql_connect ("localhost", "root ","");Mysql_select_db ('nnd', $
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
Many developers often do not consider the char and varchar types when designing databases. Some developers do not pay attention to them because the storage price is getting cheaper and cheaper, I forgot some of the basic design theories and
Copy codeThe Code is as follows:-- Create a linked serverExec sp_addmediaserver 'Connection server name', '', 'sqlodb', 'remote server name or IP address'Exec sp_addmediasrvlogin 'linked server name', 'false', null, 'linked Server Username ',
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
Mysql can use operators to perform operations on data in tables, such as age calculation by birth date.
Operators include Arithmetic Operators, comparison operators, logical operators, and bitwise operators.
Arithmetic OperatorsAddition, subtraction,
The searchd daemon of sphtracing supports MySQL binary network protocol from version 0.9.9-rc2 and can be accessed through standard MySQL APIs.For example, the "mysql" command line program can work well.
The following is an example of using the
1. Open mysql workbench and select "Create EER Model From Existing Database" in the middle of the homepage "Data Modeling ";2. In "Stored Connection", select "Manage Stored Connections ...";3. Select "New" in Manage DB Connections to create a
SQL:
Copy codeThe Code is as follows:SELECT@ Rownum: = @ rownum + 1 AS rownum,A. order_id,Case when a. Ordered = 1 then 'split into tickets 'end as Ordered,A. printed,A. order_sn,A. user_id,B. user_name,A. consignee,A. tel,A. mobile,A. address,A.
Generally, secondary indexes are used for count:For example, if id is pk aid, it is secondary index.
UseCopy codeThe Code is as follows:Select count (*) from table where id> = 0;OrSelect count (*) from table;The results are the same. pk indexes are
Dump is performed at every day to back up the corresponding database, and binlog files of the corresponding database are updated.If a database error is found, you only need to recover the previous dump backup and then restore the binlog file of the
On Weibo, we will discuss how MySQL can reduce MySQL hang time When deleting a large table engine = innodb (30G +). Here is a brief summary:When buffer_pool is large (30 GB +), because the table is deleted, the entire buffer pool will be traversed
Mysqli's support for prepare is very good for websites with large traffic volumes. It greatly reduces system overhead and ensures the stability and security of query creation. Prepare preparation statements are divided into binding parameters and
MySQL provides different storage engines for different functional requirements. The so-called storage engine is the specific implementation of specific interfaces in MySQL.FEDERATED is a specific implementation of remote databases. Generally, when
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.