Indexes do not always take effect, such as the following situations, which will result in index invalidation:
1. If there is an or in the condition, it will not be used even if there is a conditional index (which is why the use of or is as little
Doing INTERSECT and minus in MySQL
Doing an INTERSECT
An INTERSECT is simply a inner join where we compare the tuples of one table with those to the other, and select those th At appear on both while weeding out duplicates. So
Copy Code
Start: net start MySQL;Enter: Mysql-u root-p/mysql-h localhost-u root-p databaseName;List database: show databases;Select database: Use DatabaseName;List table: Show tables;Displays the properties of the table column: Show columns from
Project needs to find some information and personal configuration after the experience to share.
(1) Primary server
Modify configuration file/etc/my.cnf (My.ini)
[Mysqld]
# Mysql-bin is the prefix of the log file, you can also use other names, such
Here are four ways to use fuzzy queries in MySQL:
1,%: Represents any 0 or more characters. Can match any type and length of characters, in some cases in Chinese, please use two percent sign (%).
For example, SELECT * from [user] WHERE u_name like '
The MySQL event Scheduler is accurate to perform one task per second, and is ideal for some applications with high real-time data requirements (e.g. stocks, odds, scores, etc.).
Check to see if you want to start this feature:
Copy Code code as
MySQL is UTF8 encoding, but no matter how many UTF8 in the Web page, the results will show some small squares, and SQL statements in like Chinese, also query not come out. Instead, it is defined as gb2312, showing complete normality.
The top of
After installing Mysql-server, you will be prompted to run mysql_secure_installation. Running Mysql_secure_installation will perform several settings:A) set a password for the root user(b) Delete anonymous accountsc) Cancel remote login of root
Here, for example, MySQL, first clear the following questions:
I. GENERAL projects if you do not configure the transaction itself, the general default is autocommit, that is, after performing an operation automatically commit, commit the
1. mysql to back up a database command
Copy Code code as follows:
##################################################################
# Back up a database
##################################################################
#
After querying for inefficient SQL statements, you can obtain information about how MySQL executes the SELECT statement through the EXPLAIN or DESC commands, including the order in which tables are connected and connected during the execution of the
Several common ways to find MySQL subqueries:
Copy Code code as follows:
SELECT * from xxx where col = [Any|all] (SELECT * from XXXX);
This syntax can be divided into keyword and without keyword writing, when the keyword is not
The problem comes from a 5-year-old Baidu know the answer, just see this problem when I just went to work 21 days, then according to their own that little experience and the temporary operation of the test made the right answer at that time:
MySQL group_concat function, the complete syntax is as follows:
Copy Code code as follows:
Group_concat ([DISTINCT] The field to connect [order by Asc/desc sort field] [Separator ' delimiter]]
Basic Query
Copy Code code as
With df command checked, and sure enough disk full, because of the system by the default, I do not know why can not automatically expansion! Later on in dealing with this problem! As shown in the figure:
Copy Code code as follows:
Problem:
python2.7 query or Insert Chinese data in MySQL when the Chinese garbled
---
Possible situations:
1.mysql database items are not set to encode, default is ' Latin '
2. No default encoding is set when using Mysql.connect
3. No Python
In this paper, an example of thinkphp implementation will be stored in the MySQL method, the operating environment is ThinkPHP3.1.2 version
First set in index.php to:
Set in config.php to:
' config value '
////Add
The newly installed MySQL has two databases: Information_schema and MySQL. What are they for? Can you delete it?
Of course it is not to be deleted.
The
1.information schema is all the dictionary information used by the MySQL system, including
Depending on the profile, MySQL restricts the packet size that the server accepts. Sometimes large inserts and updates are limited by the Max_allowed_packet parameter, causing the write or update to fail.View current configuration:
Copy Code
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