See colleagues today's code, and learned a useful function, just look at the time do not understand, the search for the next use, see the following this article is very detailed on the direct reprint, I also write not so good, hehe, thank the author'
One, case, then ELSE END use usage.When you use SQL statements to count the occurrences of a certain state of a field, consider using the case and then ELSE END usage. When the amount of data is too large, it is not recommended.Example:SUM ( Case
1.Auto_increment:Only one column in the InnoDB table can be auto_increment, and this column must also be indexed.CREATE TABLE T (X int auto_increment primary key,y int); --ToCREATE table T (x int auto_increment,y int, index ix_a (x))--the
MySQL can be installed RPM package or directly yum download installation, here is about yum download installation (storage path is set by itself)Environment: centos6.5
Setenforce 0 (if 1, startup error)
Fdisk 3 partitions, and pvcreate65
Optimization Items 1,Low_priority The delete operation occurs when the article table is not connected.Delete low_priority from T;Optimization Items 2,Quick when a row is deleted, the index is not deleted, and the index can be reused if it is
Reason:The character encoding of the database table and insert statement does not match or the encoding of the database table does not support ChineseSolution:Modify the character encoding in the table to: Utf-8 (or gbk,gb2312)When you link a
Background knowledge:If the table does not specify a file location, it is saved to Data/database_name/table_file, where data is in the installation directory you specify, in order to improve IO We try our best toUsing the IO capability of multiple
Application optimization: Using connection pooling:
with a database connection pool, you can reuse database connection objects, reducing the resource consumption associated with creating new connections.
Reduce access to MySQL: Avoid
1. Start and stop of MySQL servicenet stop mysqlnet start MySQL2. Log in to MySQLMysql-u User name-p user PasswordType the command mysql-u root-p, enter the password after entering, and then enter into MySQL, MySQL prompt is:mysql>Note that if you
PackageSQL;Importjava.sql.Connection;ImportJava.sql.DriverManager;ImportJava.sql.ResultSet;Importjava.sql.SQLException;Importjava.sql.Statement; Public classJdbctest { Public StaticString driver= "Com.mysql.jdbc.Driver"; Public StaticString url=
IntroductionMy machine is win8.1, on the official website to download this installation is 32-bit and 64-bit can be installed, installation procedure reference: http://jingyan.baidu.com/article/67662997305dcd54d51b84d4.htmlPost-Installation
Note 1,Bit (length), the maximum length of this data type is only 64, which meansBit (2) toBit (64) toBit (65) wrongBit (100) wrongNote 2, serialSerial is an alias of bigint UNSIGNED not NULL auto_increment unique.Note 3,tinyint (length) can only
System: Ubuntu 14.04 LTSInstallation:Apt-get Install mysql//Installation database Apt-get install mysql-workbench//installation graphical interfaceUse:On startup: mysql-h [Address]-P [port]-u[user name]-p[password]This will be the case when you
Installing Mysql-5.5.28Since the data stored by MySQL is getting bigger and larger, I recommend storing the data on the LVM file system.1. Making LVM File systemThere is no longer a production process here, assuming we have done an LVM and mounted
The following article is mainly about the MySQL service can not start the case, cannot be completely uninstalled the actual solution of the description of the method, the following is to solve the MySQL service can not start the detailed description
First refer to the MySQL5.5 official manual for the following chapters:Section 6.4 How to set up replication13.6.1 section for controlling the primary server SQL statements13.6.2 section for controlling SQL statements from the server6.8 section copy
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.