Linux enable MySQL slow query
The code is as follows
Copy Code
Vim/etc/my.cnf[Mysqld]Slow-query-log = on # Open slow query functionSlow_query_log_file =/usr/local/mysql/data/slow-query.log # Slow query log store path and
1: Two cloud hosts have been purchased in advance
10.4.14.168 101.69.178.208 [Unicom] Master
10.4.5.9 101.69.178.219 [Unicom] Slave
2: MySQL installed separately
The code is as follows
Copy Code
#yum Install
The application scenario is this:For example, I have a table: Sm_position has a certain amount of historical data.
ID Title1 Title 12 Title 13 Title 14 Title 15 Title 1... ...1133 Title 1133
Now you need to import new data. And the new data. ID is
If you set the unique attribute, which is also sensitive to the case of varchar, the resolver
The code is as follows
Copy Code
CREATE TABLE WORDS (ID BIGINT Auto_increment,WORD VARCHAR (128) not NULL UNIQUE,PRIMARY KEY
131203 23:09:36 Mysqld_safe starting mysqld daemon with databases From/mnt/mysqldata2013-12-03 23:09:36 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (the documentation for
The following examples are to copy old_table to new_table.
To start with the conclusion, the most recommended practice is the following two lines:
The code is as follows
Copy Code
CREATE TABLE new_table like
The length () function can get the lengths of a string:
Select Length (' ABCDEFG '), Length (' 0123456789 ');/*+-------------------+----------------------+| Length (' ABCDEFG ') | Length (' 0123456789 ') |+-------------------+----------------------+
1. Error logUse the –log-error[=file_name] option to specify where MYSQLD saves the error log file. If the file_name value is not given, MYSQLD uses the error log name Host_name.err and writes to the log file in the data directory. If you perform
When you use SQLyog to export a dedecms database as a xxx.sql file, several errors are reported:
Error 1064 online 21: You have an error in your SQL syntax. Check manual t hat corresponds to your MySQL server version for correct syntax, use near '
SQL Category:ddl-Data Definition language (create,alter,drop,declare)dml-Data Manipulation Language (Select,delete,update,insert)dcl-Data Control Language (Grant,revoke,commit,rollback)
First, briefly introduce the underlying statement:1,
Single-table MySQL UPDATE statement:
The code is as follows
Copy Code
UPDATE [low_priority] [IGNORE] Tbl_nameSET col_name1=expr1 [, col_name2=expr2 ...][WHERE Where_definition][Order BY ...][LIMIT Row_count]Update
The code is as follows
Copy Code
SELECT keyword, COUNT (*) as CountFrom Article_keywordGROUP by keywordOrder BY Count DESCLIMIT 20
This query statement returns 20 records with the most keyword repeat count (count) in the
The development of the Web site backend system in the test process, this problem occurs:Invalid query:duplicate entry ' 127′for key 1SQL is:insert into ' kq_news ' (' Title ', ' Author ', ' Type ', ' Content ', ' Isdel ', ' adate ', ' Range ', '
MySQL tutorial SQL enum data type INSERT, UPDATE, delete operation
The enum column always has 1 default values. If you do not specify a default value, the default value is NULL for columns that contain NULL, otherwise the 1th enumeration value will
In fact, we used only the MySQL tutorial show usage in fact one, in the MySQL simple operation as follows
Show Table
This will show all the tables, but in the PHP tutorial, we'll look at the following code
$server = ' localhost ';
$user = '
MySQL Tutorial database tutorial defining automatic backup Data
MySQL Installation Location: D:appservmysqlForum database name is: FlowMySQL Root Password: 526888Database backup destinations: F:databackup
Program code
for/f "Tokens=1 delims=/
Coreseek installation is troublesome, the Official handbook is not very good support for this. Coreseek is a Chinese word segmentation and Full-text search software based on Sphinx. This article is to install and debug Coreseek under the Mac OS x
Key_buffer_size
Set this variable to assign a space of the specified size to the key buffer (or key cache). But the operating system will only be allocated when the space is actually used. For example, setting the key buffer size to 1GB does not
But for the first time I touched mysql, I did not understand it.Now, let's talk about the process of solving the problem:Follow the mysql installation steps:Shell> groupadd mysqlShell> useradd-g mysqlShell> gunzip | mysql-VERSION.tar.gz |
My blog is built on a kvm vps. Today I also wrote a fabfile to dump the database, package the WordPress directory, and download it to the local machine. The fabfile code is as follows: The code is as follows:Copy code #! /Usr/bin/python# Use
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