Tools/raw Materials
Win7 Operating system
Mysqlzip Format installation Package
Method/Step
The MySQL installation file is divided into two types, one in MSI format and one in ZIP format. If the MSI format can be directly clicked on the
First, the installation of MySQL
Running the MySQL installer (mysql-essential-5.1.40-win32.msi)
Select Install type is Custom
Click the Change button to modify the installation directory
Change installation directory to D disk (can be
Looking for some information, and then I used the MySQL string processing of two functions concat () and left ()
1, CONCAT (str1,str2,...)
Returns a string from the argument's link. Returns null if any argument is null. can have more than 2
When you apply MySQL, you will encounter situations where you cannot create a function. The following error message appears:
Copy Code code as follows:
ERROR 1418:this function has none of deterministic, NO SQL, or reads SQL DATA in
In many cases, the database defaults are null, but the case is that the database values are empty rather than NULL when the program is processed. Note When a unique index is created, when the database will empty as multiple duplicate values, and the
This article describes the MySQL use of Group_concat merged with a number of data display methods, to share with you for your reference. The implementation methods are as follows:
Suppose there is such a requirement:1: Class table:ID class_name2:
The COALESCE function can accept more than one argument and returns the first Non-null value of those arguments, or null if all the supplied arguments are nullThe Ifnull function, like the COALESCE function, can only accept two parametersThe IF
Reason Analysis:
The reason that MySQL cannot create an automatically incremented field is that it adds several sql_mode to the Server SQL Mode in the MySQL5.0.2 version, and that the Sql-mode in the SQL My.ini file adds two of them by default. One
MySQL database provides two types of indexes, if not set correctly, the efficiency of the index will be greatly compromised but the problem is completely unknown.
Copy Code code as follows:
CREATE TABLE Test (
ID INT not NULL,
MySQL installation is often found not normal boot encountered the most error 2003 errors, the following is the solution:
Mysqld-nt-remove
Mysqld-nt-install
Restart MySQL
net start MySQL
There may also be a problem with the service 1067
Detect if event is turned on
Copy Code code as follows:
Show variables like ' Event_scheduler ';
2. Open Event
Copy Code code as follows:
Set global Event_scheduler = on;
3. Create a stored
Indexes do not always take effect, such as the following situations, which will result in index invalidation:
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 as
Linux can use the crontab system to regularly back up the MySQL database every day, the following are detailed steps:
1, create the path to save the backup file/mysqldata
#mkdir/mysqldata
2. Create/usr/sbin/bakmysql files
#vi/usr/sbin/bakmysql
Create triggers. The syntax for creating triggers is as follows:
CREATE TRIGGER trigger_name trigger_time trigger_event
On tbl_name for each ROW trigger_stmt
Where the trigger_name identifies the trigger name and is specified by the user;
Problem Description:
Ordinary desktop, collect data, the table already has >1000 million data quantity.
The data collected is slow to insert into the table, 100 milliseconds per treaty.
Workaround:
1, enlarge the MySQL configuration in the
One day, two people do not know the MySQL kernel to understand the MySQL kernel code, two people are not to debug the code, find information, but over there to think. Because you do not understand the kernel, so think side to verify.The MySQL code
In MySQL, query 5 data without duplication, using the following:
Copy Code code as follows:
SELECT * from ' table ' ORDER by RAND () LIMIT 5
It's OK. But the real test was found to be very inefficient. A library of more
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.