Code name Sex ethnic Birthdays 1. Create a Mysqli object, create a Connection object$db = new mysqli ("localhost", "username", "password", "database Name");2. Prepare an SQL statement$sql = "SELECT * from Info";3. Execute the SQL statement and,
MySQL indexes fall into the following categories: Fulltext, Hash,btree,rtree.Fulltext: Full-Text Search indexMainly to solve the problem of low query efficiency such as ' ad% ', which can only be used on MyISAM and InnoDB engines.Hash: Hashed
The nature of the indexThe official MySQL definition for an index is: The index is the data structure that helps MySQL to get data efficiently. It can be understood that the index is a data structure.We know that database query is one of the most
First, server-side settingsOpen MySQL database, runGRANT All Privileges on *. * to ' MyUser '@'192.168.1.3'by'mypassword' withGRANTOPTION;MyUser: Server's Database login nameMyPassword: Server Database login Password192.168.1.3: Allows client IP
I. The role of affairsA transaction is a sequence of successive operations that will occur.Transaction security is to ensure that the results of a series of operations are kept in sync to ensure data integrity.When a transaction is turned on, the
The MySQL database has a concept of autocommit transactions, autocommit. The implication is that if autocommit is turned on, each statement is automatically committed after execution. That is, a statement is treated as a transaction.In the mysqldb
Some of the more well-spoken information:Http://www.cnblogs.com/liangshaoye/p/5464794.html: Explains the hot spare, Win Bei, cold, incremental backup, differential backup and many other concepts.Http://www.cnblogs.com/guoyibao/p/3867634.html:
First, the index length and the degree of differentiation are contradictory,The index length is too short, then the sensitivity is very low, the index length is longer, the sensitivity is high, but the index is to occupy memory, so we need to find a
I. Creating process syntaxCREATE PROCEDURE procedure name (parameter list)Begin--SQL statement ...End-- create a stored procedure delimiter $$ Create procedure my_act () begin Select * from goods; End $ $delimiter;Second, the review process--
I. INTRODUCTION OF TriggersTrigger (trigger), bind some code in advance for a table, and when this table data changes, the system will automatically call these bound code.Event Type: Insert, delete, updateTrigger time: befor, afterEvent object: Each
Case: MySQL can only log on localhost, use #mysql-uroot-p-hip-p3306 cannot log inWorkaround:1. Change the table method. It may be that your account is not allowed to log on remotely, only on localhost. This time, as long as the computer on the
First, new dataInsert into view name [(field list)] VALUES (list of values);Note:1. Multiple table views cannot add data.2. A single table view has a base table all fields that cannot be empty or have no default values can add data.Ii. deletion of
Database update and Backup is one of the basic functions of operations, and here is the operation of the statement to do a tidy, not regularly updated.1) Database backup statementsMYSQLDUMP-H Database IP address-u user name-p password ABC XYZ >
Select* from where a.batch_no = ' ss20170123181418' ;This is the original data:This is what it looks like after a row-to-column:SelectA.debt_type,sum( Case whenDebt_type='0' ThenAMOUNTEND)'Initial Debt',sum( Case whenDebt_type='1'
A strange MySQL replication faultA MySQL disaster recovery database is deployed in a remote data center. After the deployment, the replication process looks normal. However, after observing the MySQL error log, the replication thread will be
[Reprinted] mysql PARTITION and mysqlpartition
Address: http://lobert.iteye.com/blog/1955841
The previous day, we got a table with nearly million data records and no indexes or primary keys. (This table is definitely a talent)
This is a log table
PACK_KEYS and mysqlPACK_KEYS in mysql
Original http://jackyrong.iteye.com/blog/2170222
One of the myisam engines in mysql is easy to ignore, called the compressed index PACK_KEYS,
MyISAM uses prefix compression to reduce the index size. By default,
MySQL index and mysql Index
Mysql indexes use B + tree. B + tree is a variant of the balanced binary tree, so the query speed is very fast. (B + tree: https://zh.wikipedia.org/zh-hans/ B %2B%E6%A0%91)
Indexes mainly include clustered indexes and
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