Use two functions: length and char_length.
Length: the length of a calculated field. A Chinese character is counted as three characters. A number or letter is counted as one character.
Char_length: whether it is a Chinese character, a number, or a
Status Series
Mysql provides a series of commands to obtain the running status of the database. The most common commands are show status, show innodb status, show processlist, and show mutex status. Through these commands, we can learn the database
In the previous collection script, the collection time is taken out in the form of unix timestamps. When writing SQL statements, you need to query the corresponding records by time, the $ time passed in on the page is a string like '2017-01'. How
MySQL Cluster is a highly practical and redundant MySQL version suitable for distributed computing environments. It uses the NDB Cluster Storage engine and allows multiple MySQL servers to run in one Cluster. This storage engine is provided in
Today, a colleague told me that the account and password were not case sensitive when we logged on to the game. Later, we found that the account and role creation were not case sensitive. After thinking about the login process, Mysql is case
EXPLAIN your SELECT query
The EXPLAIN keyword helps you know how MySQL processes your SQL statements. This helps you analyze the performance bottleneck of your query statement or table structure.The EXPLAIN query results also show you how your
Part 1 configure MASTER (10.0.0.1)
1. Enable binary logging on the master database server and assign a unique server-id. Open the configuration file/etc/qa_my.cnf and add the command under the [mysqld] group:
[mysqld]log-bin=mysql-binserver-id=3
2.
The create procedure proc1 (OUT s int) process in mysql is simple, but the 1307 error occurs during the import process, let's take a look at the solution to this problem.
Test
The Code is as follows:
Copy code
Create
How can I recover an ibdata1 database deleted by mysql by mistake?
If ibdata1 and ib_logfile * related to mysql innodb are deleted by mistake on the online server *,How should we restore it?
At this time it should be cold sweat, right?===============
Recently, I have been getting familiar with MySQL and it is imminent to understand how to optimize it. To do this, you must first sharpen the tool. Recently, I plan to learn about several frequently used tools to optimize MySQL. Today, I will give a
In mysql, UNION queries are combined with multi-table queries. Here we will give you a general introduction to the syntax usage and Performance Comparison of UNION queries, hoping to help you.
I. union query usage
The union query is relatively
I have introduced how to update another table with one table. Now let's take A look at the SQL statement article about mysql update updating table B based on table A. I hope this article will help you.
Recently, I encountered A requirement that both
REGEXPExample 1. the query field contains non-English dataCopy codeThe Code is as follows:SELECT *FROM'm _ user'WHERE 'emp_no'REGEXP '[^-~] '= 1 Column 2. In this way, all non-English content can be obtained.Copy codeThe Code is as follows:SELECT
Use the DATE_FORMAT MethodSELECT * FROM 'ler _ items 'WHERE DATE_FORMAT (postTime,' % Y-% m') = '2017-03'Note: The date must use ''; otherwise, it will not work.Other mysql date search statementsMysql> select date_format (DATE_SUB (CURDATE (),
In a string, if a sequence has a special meaning, each sequence starts with a backslash ("") and is called an escape character. MySQL recognizes the following escape characters:
0An ASCII 0 (NUL) character.'It is a string of 39 ASCII single
Because Mysql is installed from the source code package, there is no common servcie mysqld restart script in the system.You have to manually restartSomeone suggested Killall mysql. This brutal method is actually not feasible. If forced termination
Example 1: A simple Stored Procedure cursor instanceCopy codeThe Code is as follows:DELIMITER $Drop procedure if exists getUserInfo $Create procedure getUserInfo (in date_day datetime)---- Instance-- Stored procedure name: getUserInfo-- Parameter:
First, declare that, in general, you need to have the root permission in MySQL to modify the mysql password and grant permissions.Note: This operation is performed at the WIN command prompt, and phpMyAdmin is also applicable.User: phplamp user
Mysql comes with a very useful script for managing mysql services. The default path is $ MYSQL_HOME/support-files. The file name is mysql. server. $ MYSQL_HOME is the installation root directory of mysql. Mysql. server Usage:./mysql. server
1.
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