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.
Mysql_affected_rows: Gets the number of columns affected by MySQL last operation.Mysql_close: Close the MySQL server connection.Mysql_connect: Open the MySQL server connection.mysql_create_db: Create a new MySQL database.Mysql_data_seek: Moves the
Mathematical functionsAbsolute ABS ()Pi ()Square root sqrt ()Modulo to remove the remainder mod (dividend, divisor)Random number rand ()Rounding Round (number)Second party POW (5,2)E is the bottom exponent function exp (number)String functionsLength
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
1. Create a Java project in Eclipse
2. Introduce the JDBC Library (in extenrnal of bulid path)
3.
1) import the SQL package (import java. SQL .*)
2) load (Register) the mysql jdbc driver
Class. forName ("com. mysql. jdbc. Driver ");
3) connect to
Show [session | global] status you can add the parameter "session" or "global" as needed to display the session-level (current connection) statistics and global-level (since the last time the database was started). If this parameter is not specified,
Start MySQL
1. initialization module execution & initial storage engine execution
2. After the execution is completed in step 1 ----> the connection management module takes over
3. The connection management module starts the listening program
Mysql provides three installation methods: binary, rpm, and source code compilation. Here we will discuss in detail how to compile and install mysql source code.
Mysql does not support configure compilation after version 5.5. Instead, it uses the
LNMP1.0 can be used to quickly build a PHP environment in a Linux system. Previously, the LNMP environment has been used to operate other servers, and similar errors have not been detected. Now we will record the solution process.
I. server
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
Scenario:Master database DB: utf8 Character SetSlave database DB: gbk character set
Requirements:Verify that the master and slave data are consistent and repair
Verification process:Set the master database connection to utf8, set the slave database
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 Stored Procedure in END compound statement usage example
Begin_label:] BEGIN
[Statement_list]
END [end_label]
You can use the in... END compound statement to store subprograms to contain multiple statements. Statement_list indicates the
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 database KEY partition usage
Partitioning by KEY is similar to partitioning by HASH. Except for the User-Defined expression used by HASH partition, the HASH function of KEY partition is provided by the MySQL server. MySQL Cluster uses the MD5
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