Recently in the study of MySQL, of course, the first to install it on the machine. Record the operation, deepen the memory, also for later reference.Preparatory work:Linux version:Redhat Linux 6.4MySQL version (installation package):
Database:Create Database|schema [if not exists] db_name [Character set =] [collate =];ALTER DATABASEDrop {database | schema} [if exists] db_name;Table:1, directly define an empty table;2, from other tables to query the data, and create a new table;3.
1. Slow Query log:Slow_launch_time=2 the value of a query greater than a certain time (unit: s)Slow_query_log=on/off Turn off slow query logSlow_query_log_file=/opt/data/host-slow.log Slow Query Log location2. Number of connections:Max_connections
This mysql.sock should be MySQL host and client on the same host, use UNIX domain socket as the carrier of communication protocol, it is faster than TCP. The common cause of this problem is that your MySQL server is not running.There are two ways to
1. First verify that the server is in a secure state, that is, no one can connect to the MySQL database arbitrarily.Because the MySQL database is completely password-protected during the reset of the root password of MySQLStatus, other users can
() WHERE clause operator= equals<> Not equal to! = does not equal> Greater than>= greater than or equal toBetween between the specified two valuesFor example:Find the student number from 0007 to 0009 (not including 0009)?select* from Student_info
We often encounter, when deleting a record of the database, the original ID sort will have an interval, such as the deletion of the data ID 8, the table ID sort from 7 directly to 9,So how do we solve this problem of re-arranging the ID?Just three
InnoDB Index Concept Summary record InnoDB index concepts for viewing INNODB index classification: Clustered index (clustered index) 1) When a primary key is available, a clustered index is created from the primary key 2) when there is
Download MySQL database: http://dev.mysql.com/downloads/mysql/, unzip to localDownload jar package: http://dev.mysql.com/downloads/connector/j/, download zip archive packageCreate a database and insert several data:Create TableMyDB; UseMyDB;Create
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)Solve:1, first stop the MySQL service, the command is as follows:#/etc/init.d/mysql stop2, restart the service, the command is as follows:#/etc/init.d/mysql Stop#
How mysql locks a single tableCopy codeThe Code is as follows:Mysql> lock table userstat read;Mysql> unlock tables;A typical page-level engine is BDB.A typical table-level engine is MyISAM, MEMORY, and ISAM, which was a long time ago.A typical
We all know that com_insert and other com_xxx parameters can be used to monitor the access volume of database instances, which is what we often call QPS. Based on the MySQL replication principle, all operations performed by the master database are
We all know that com_insert and other com_xxx parameters can be used to monitor the access volume of database instances, which is what we often call QPS. Based on the MySQL replication principle, all operations performed by the master database are
Mysql isnull usage
MySQL can use the ISNULL () function. However, it works in a different way than Microsoft's ISNULL () function.
Let's first look at the usage of several is null SQL statements:
Select * from newtable where name is null // obtain
What functions does mysql use to execute mysql statements?
Definition and usage
The mysql_query () function executes a MySQL query.
Syntax
Mysql_query (query, connection) parameter description
Query is required. Specifies the SQL query to be sent.
Mysql release result memory sample code
Definition and usage
The mysql_free_result () function releases the result memory.
If the operation succeeds, true is returned. If the operation fails, false is returned.
Syntax
Mysql_free_result (data)
Mysql uses the WKB function to create Geometry (ry) Values
MySQL provides many functions that use BLOB containing WKT expressions or optional Spatial Reference System ID (SRID) as input parameters. They return corresponding geometric
MySQL Spatial Data Types
MySQL has a data type that corresponds to the OpenGIS class. Some types can only save a single geometric value:
· GEOMETRY
· POINT
· LINESTRING
· POLYGON
GEOMETRY can store geometric values of any type. Other
How to update database fields in mysql
Syntax
UPDATE table_name SET column_name = new_value WHERE column_name = some_value
Note: SQL is case insensitive. UPDATE is equivalent to update.
In order for PHP to execute the preceding statement, we must
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.