Common query optimization
1:max () Optimization: Adding indexes to the corresponding columns2:count () Optimization: COUNT (*) calculates the number of containing null records, and COUNT (Field_name) contains only the number of Nulls (this is also
Model: Free 2g Universal space-exempt Current: 0 yuan/month Original price: 50 yuan/month Content: Windows 2003 R2+IIS6 • China Military Region dual-line room, no record (Exclusive in China) • Support 2 domain bindings 2g Web space,
Three free PHP tutorials for MySQL Tutorials ASP Tutorials Personal Homepage Space application
Midphase free space reopened:-200MB Space-5GB Month Flow-2 domain Names-2 Database Tutorials-California fremont[Freemont] room, ping is good-DirectAdmin
has been stuck on a very strange database issue for a long time, slow log is full of some very basic SQL statements, the primary key query or update the simple field based on the primary key, should be the milliseconds to return the results of the
You cannot connect to the server through '/tmp/mysql.sock ', and the PHP standard configuration is using '/tmp/mysql.sock ', but some MySQL installation methods will
Mysql.sock in/var/lib/mysql.sock or whatever, you can fix it by modifying
The MySQL order BY keyword is used to classify the data in the record.
MySQL ORDER BY keyword classified by keyword
The ORDER BY keyword is used to classify the data in a record.
MySQL ORDER BY syntax
The code is as follows
Copy
Linux is not specifically designed for MSSQL access to the library, but between the MSSQL is derived from Sybase, so access to Sybase's library can naturally access Mssql,freetds is such a realization.Perl typically uses DBI to access the database,
Prepare an article
First, the environment description:
Operating system: Windows Server R2
PHP Version: PHP 5.5.8
MySQL version: MySQL5.6.15
Second, related software downloads:
1, PHP download address:
The way to reduce this type of problem is to minimize the loss of power to the server and shut down the MySQL database manually when shutting down the server.
Here's a look at this question:
Can ' t open file: ' xxx. Myi ' (errno:145), this error
Test the PHP file
$link =mysql_connect (' localhost ', ' root ', ' zz ') or Die (Mysql_error ());
mysql_select_db (' test ') or Die (' no db ');
mysql_query (' SET NAMES utf8 ');
Echo 99;
?>
Error after run
Can ' t connect to the local MySQL server
In MySQL limit can achieve fast paging, but if the data to millions of when our limit must be optimized to effectively achieve a reasonable paging, otherwise may be stuck to your server oh.
When a table data has millions of of the data is a problem!
Because the UTF8 character set is the character set that is best suited to implement conversions between many different character sets, although you may not be able to view the contents of the database correctly on command-line tools, I strongly
Environment description
This article is used only as the minimum experimental environment, and therefore does not use master, slave mode. Use Mysql_mutil to run two MySQL real columns on a single computerInitializing the Data directory
#
MySQL database in the query, sometimes the English letter case sensitive, sometimes not, mainly by the MySQL character validation rules of the setting of the decision, usually by default is not supported uppercase and lowercase sensitive.
1. What
To see if the event Scheduler is currently open, you can perform the following sql:
Show VARIABLES like ' Event_scheduler ';Or
SELECT @ @event_scheduler;Or
Show Processlist;If the display:
+-----------------+-------+| variable_name | Value |+----
Database structureAnd I want to make the same person's different grades into this person. displayed on different columns of this line, this time divided into 2 shows:The first shows----"Multiple rows to one column" (the merged data is on the same
For data security, sometimes the database needs to delay backup, here are two ways to delay backup.First, the use of tools.Implementing the Environment:192.168.189.143 (MySQL Main library)192.168.189.144 (MySQL standby, 3 minutes delay)Steps:1:
Simple MySQL optimization tool-slow query and mysql optimization tool
Slow Query
First, enabling slow queries is a prerequisite regardless of the optimization. The slow query Mechanism records slow query statements (events) to provide optimization
IntroductionOptimizing SQL is a common task of DBA. How to optimize a statement efficiently and quickly is a common problem for every DBA. In my daily optimization work, I found that many operations are essential in the optimization process. However,
In a production environment, logstash often processes logs in multiple formats. Different log formats have different parsing methods. The following is an example of how logstash processes multi-line logs and analyzes MySQL slow query logs. This is a
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.