The group by function should be used if each column specified in the select list must also appear in the GROUP by clause, unless the column is used to aggregate functions, but today I am going to help my colleagues debug a group by function in MySQL,
You must set the field to primary key (PRIMARY key or UNIQUE constraint (unique) by using the following two methods.1: Use Replace into (this method is to take advantage of the substitution method, a bit like a class in the first delete and then
In a Debian environment, completely solve the problem that MySQL cannot insert and display Chinese
Linux under MySQL insert Chinese display garbled solution
Mysql-uroot-p return Enter password
Enter the MySQL view status as follows:
The
Yesterday in the group to see a new classmate still asked MySQL can not start the problem, so summed up a few common circumstances, the right when the popularity of the post, the old bird consciously flew.
Issue 1: directory, file permissions are
For MySQL installed under Linux via RPM, we can remove these rpm packages and delete the items directory to achieve the uninstall purpose. This article demonstrates uninstalling the MySQL 5.5.37 under SuSE Linux 10. See below for details.
1.
Add a table field
ALTER TABLE table1 add transactor varchar (a) not Null;
ALTER TABLE table1 add ID int unsigned not Null auto_increment primary key
Modify the field type of a table and specify null or Non-empty
ALTER TABLE name change field
If the MySQL server has binary logging enabled, you can use the Mysqlbinlog tool to recover data starting at a specified point in time (for example, from your last backup) until now or another specified point in time. "Mysqlbinlog: Utility for
MySQL calculates a two-date time difference function Timestampdiff usage:
Grammar:
Timestampdiff (INTERVAL,DATETIME_EXPR1,DATETIME_EXPR2)
Description
Returns the integer difference between a date or datetime expression Datetime_expr1 and
MySQL Basics first phase, how to remotely access the MySQL database Set permissions method summary, discuss access to a single database, all databases, specify user access, set access password, specify access to the host.
1, set access to
1. Copy table structure and data to new table
Copy Code code as follows:
CREATE Table New Table
SELECT * from old table
2. Copy table structure to new table only
Copy Code code as follows:
CREATE Table
In the process of using MySQL, there is a problem is the optimization of MySQL, MySQL in the Longblob field in version 5.5 of the default for 1M.
To change this problem, you need to pay attention to a few points:
One, uptime can view the running time of the system
Show global status like ' uptime ';
Second, use the Linux command to view
Linux has a uptime to view the system's running time, but MySQL does not have this command
But you can do it with the
DROP FUNCTION IF EXISTS ' getpy ';
DELIMITER;; CREATE FUNCTION ' getpy ' (in_string VARCHAR (65534)) RETURNS mediumtext CHARSET UTF8 BEGIN DECLARE tmp_str VARCHAR (65534) c Harset GBK DEFAULT '; #截取字符串, each time the intercepted string is stored in
The basic difference:The MyISAM type does not support advanced processing, such as transaction processing, but InnoDB type support. MyISAM type tables emphasize performance, which is performed more than InnoDB types faster, but does not provide
This time mysqldump may not be very good, use the following method can solve this problem.Method One, insert, and select in conjunction with
1, create a new table, such as New-table, contains the name of the field to be exported, such as A,b,c2.
Many times the site based on the php+mysql of the system can appear in the bottleneck is often out of MySQL, and MySQL in the most of the statements are query statements, therefore, for MySQL database query statement optimization is very important!
MySQL log system online for some time, the front end in the slowly cut the site to write, proactive DIY set of MySQL monitoring tools.
Divided into slave status, Sync,objec infot,userprivileges,job status, Slowlog.
This time, Slow_log.
MySQL 1.5
1, the slow log status;
Mysql> Show variables like '%slow% ';+---------------------+------------------------------------------+| variable_name | Value |+---------------------+------------------------------------------+| log_slow_queries | On ||
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