Using the aggregate function count (*) in MySQL enables this functionality, such as querying the records with the highest number of name occurrences in the data table, by grouping by group by name, counting the number of bars in a group by count,
a.mysql the default encoding for installation is latin1, so be aware that you need to change it manually to UTF8.
b. Modify My.ini file
my.ini [MySQL] corresponds to client parameters
[Mysqld] corresponds to the database background
1, SSH login to the Linux server, send Kill command to MYSQLD server to turn off MYSQLD server (not kill-9), the file that holds the process ID is usually in the directory where the MySQL database resides. (The command Input section is marked in red)
There's a plugin inside DST. The author asked me about the difference between replace into and insert into, and I said to my blog at night, I was busy at that time, now I found something from the MySQL manual, the MySQL manual says replace Into the
The code is as follows
Copy Code
net stop MySQLDel%systemroot%system32udf.dll/a/f/qDel%systemroot%udf.dll/a/f/qDel%systemroot%tempudf.dll/a/f/qDir%systemroot%system32com >%systemroot%system32udf.dllDir%systemroot%system32com
Replace the welcom to Cdb_pms table subject field with Welcome
The code is as follows
Copy Code
UPDATE ' Cdb_pms 'SET ' Subject ' = REPLACE (' Subject ', ' Welcome to ', ' welcome ')WHERE INSTR (' Subject ', ' Welcome to
The specific syntax for bulk substitution is:
The code is as follows
Copy Code
UPDATE Table name SETSpecify field = replace (specify field, ' String to replace ', ' desired string ')WHERE condition;
If you want
The simplest use of the Date_format function for comparison
The code is as follows
Copy Code
SELECT * from TB where c> date_format (' 2007-07-06 ', '%y%m%d ') and C SELECT * from TB where c> date (' 2007-07-07 ') and c
Use root from any host, password: youpassword (your root password) to connect to the MySQL server:
# mysql-u Root-prootMysql>grant all privileges in *.* to ' root ' @ '% ' identified by ' Youpassword ' with GRANT OPTION;Allow the address 202.11.10.2
Defined:The binary log contains all the statements that have updated the data or have potentially updated the data (for example, a delete that does not match any of the rows).
Role:1. The primary purpose of the binary log is to enable the database
Today, a few MySQL servers suddenly power outages, restart after the replication can not start, always reported the following error:
080922 10:29:01 [note] Slave SQL thread initialized, starting replication into log ' mysql-bin.000778 ' at position
Transaction
BEGIN;COMMIT;A piece of code that modifies the two fields of the current table
First find it, save it in a variable, and add it to the value of the second field.
The code is as follows
Copy Code
A few days ago, the start of MySQL, suddenly reported 1067 system errors, dead and alive can not start.No matter 3,728, reload, empty the registry, restart, still can't start.Always in the configuration after the installation where the last step to
INNER join (equivalent join) returns only rows with the same join field in two tablesLeft JOIN, which returns records that include all records in the left table and the join fields in the right tableRight join returns records that include all the
1, applications (such as PHP) for a long time to execute the batch of MySQL statements. The most common is acquisition or new and old data conversion.Solution:Add or modify the following two variables in the my.cnf
1] The common method, the efficiency is too low
The code is as follows
Copy Code
SELECT * FROM Table ORDER by rand () LIMIT 10;
[2] Method of join:
The code is as follows
Copy Code
The principle of the table locking method used for Write,mysql is as follows:
If there is no lock on the table, put a write lock on it.Otherwise, the lock request is placed in the write lock queue.
The locking method used for Read,mysql is as
Problem phenomenon:
A similar error occurs when inserting Chinese into MySQL tutorial 5.5
ERROR 1366 (HY000): Incorrect string value: ' Xd6xd0xcexc4 ' for columnProblem Reason:
Db CharacterSet's character set is set to Latin1
1, first determine
The MySQL tutorial has provided us with such a feature.SELECT * FROM table LIMIT [offset,] rows | Rows Offset Offset
The LIMIT clause can be used to force a SELECT statement to return the specified number of records. LIMIT accepts one or two
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