Recently, due to the increase in database read requests, there was a serious read/write lock problem. Due to Master/Slave separation, the master server quickly completed the write operation, however, a large number of select queries in the slave
This article introduces six useful MySQL SQL statements. Many may use PHP to implement these functions.
1. Calculate the number of years
You figured out how old this person is on your birthday.
Select date_format (from_days (to_days (now ()-to_
ArticleDirectory
Int type
Float, double, and decimal types
Char and varchar types
Text and blob types
Date, time, and tear types
Dateyime and timestamp types
Enum type
Set Type
Value Type
MySQL numeric data
The system information function is used to query the system information of the MySQL database. Version () returns the database version number.
MySQL > Select Version (); + -- ----------------------- + | Version () | + -- -------------------
ArticleDirectory
Correlation search
Reprinted from: https://joyqi.com/information-tech/use-comma-in-mysql-columns.html
Most developers should have encountered the experience of storing comma-separated strings in MySQL fields.
First, go to the MySQL official website to download MySQL connector/C ++
Http://dev.mysql.com/downloads/connector/cpp/
Download the corresponding version based on your system platform. The folder name is too long. Change "mysql-connector-C
MySQL common command line
MySQL often uses the number command line to get started and stop MySQLNet stop MySQLNet start MySQLSecond, login to MySQLSyntax: mysql-u user name-P User PasswordEnter mysql-uroot-P, press enter and prompt you to enter
MySQL database management:
Download the phpMyAdmin software, decompress the package, and find a file: config. inc. PHP (or config. *. The file name varies with phpMyAdmin versions.) modify the following Configuration:Then you FTP to your website,
MySQL Date and Time Functions
Dayofweek (date)The return date is the day of the week (1 = Sunday, 2 = Monday ,...... 7 = Saturday, ODBC Standard)Mysql> select dayofweek ('2017-02-03 ');-> 3Weekday (date)Returns the date of a week (0 = Monday, 1
Lets see how do we import bulk data in MySQL database? To deal with MySQL database we first need MySQL. net connector, which can be downloaded from here. when you install this connector, it will give you DLLs required to deal with MySQL database
(SPARK) openfire is a very good IM server, and it is implemented in pure Java and has multiple platform versions. Its data storage can use a variety of databases, such as MySQL and Oracle.
In actual use, the most common problem encountered is the
Advantages and disadvantages of SQL statements
Select * From node_revisions where NID in (select max (NID) from node)BetterSelect @ maxid: = max (NID) from node;Select * From node_revisions where nid = @ maxid
Select * from node where NID>
TransactionsProcessing is widely used in various management systems, such as the personnel management system. Many database operations need to be synchronized.TransactionsProcessing. For example, in the personnel management system, if you delete a
// Note: MySQL must use the InnoDB engine to support the transaction function. Otherwise, the following transaction-related code will be invalid.
// SQL Server and Oracle have not been tried yet. I will go back to the company tomorrow and try again.
Here is an example of using the date function. The following query Selects all records. The value of date_col is within the last 30 days:
Mysql> select something from tableWhere to_days (now ()-to_days (date_col)
Dayofweek (date)Returns the
We know that there are four transaction isolation levels in the relational database standard:
Uncommitted read (read uncommitted): Dirty read is allowed, that is, data that may be read from other sessions that have not committed transaction
From: http://hi.baidu.com/anson7722/blog/item/dd0f5c02357f5b024afb51ba.html
Explain is a keyword used by MySQL to explain select queries and can be easily used for debugging.Syntax format:Explain tbl_nameOr:Explain select select_optionsThe explain
First install MySQL, vs2008
Add the following code to the. cpp file of the VC ++ project:
# Include // define socket # include "MySQL. H "// # pragma comment (Lib," libmysql. lib "); // Add libmysql to the attached dependency. lib functions are the
Document directory
1.1 connect to MySQL
1.2 change New Password
1.3 new users added
1.4 Start and Stop MySQL
2.1 database operations
2.2 table operations
3.1 export database files from a database
3.2 importing data from external files to
Go to the instance first, so that you do not get depressed!
Instance:
How to insert the datetime type of MySQL in Java
Date = new date ();
Timestamp timestamp = new timestamp (date. gettime ());
Clientinfo. setclientinfoaddtime (timestamp );
The
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