1, the slow log status;
Mysql> Show variables like '%slow% ';+---------------------+------------------------------------------+| variable_name | Value |+---------------------+------------------------------------------+| log_slow_queries | On ||
To see if logging is enabled
Copy Code code as follows:
Mysql>show variables like ' log_bin ';
How to know the current log
Copy Code code as follows:
Mysql> Show master status;
Show number of binary
This can be done in SQL Server:
Copy Code code as follows:
If not exists (select 1 from t where id = 1)
INSERT into T (ID, Update_time) VALUES (1, GETDATE ())
Else
Update T Set update_time = GETDATE () Where id = 1
So
It is no wonder that the 3 paradigm of database design, which was served as "the Bible" N years ago, has long been inapplicable. Here I have organized some of the more common database table structure design optimization techniques, I hope to be
Today found that MySQL can use a slash to be the name of the field, this is an unexpected discovery.
Copy Code code as follows:
CREATE TABLE ' Op_day ' (
' id ' int (one) not NULL auto_increment,
' Date ' is not NULL DEFAULT ' 0000-00-00
There are several main ways in which MySQL replicates table structures using the command line:
1. Copy table structure to new table only
CREATE Table New Table SELECT * from old table WHERE 1=2
Or
CREATE table new table like old
Environment: mysql-5.1.61
Operating system: cent-os6.3
Purpose: To upgrade to MySQL 5.6.19
First of all, yum is not feasible. Because Yum source is not updated, I have used the source of 163 NetEase, but still not. The latest version is still not
Customer service There is a need for me to some hotels in Chinese pinyin sorting, has not previously contacted, in the PHP group asked some Daniel. You get 2 answers, all of them. haha ~The following is a MSYQL example, the table structure is utf-8
MySQL's exception handling analysis is as follows:
Standard format
DECLARE Handler_type handler for condition_value[,...] statement
handler_type:
CONTINUE
| EXIT
| UNDO-This temporarily does not support
condition_value:
SQLSTATE
How MySQL locks a single table
Copy Code code as follows:
Mysql>lock table Userstat Read;
Mysql>unlock tables;
The typical page-level representative engine is BDB.
The typical representative engine for the table level is
Things have been busy for a while, and recently a department change is going to be done for new projects. It's exciting to learn a lot of new knowledge. Today after work back to check the VPS status, found that the VPS space only 1G more! The first
String substitution processing using case
Copy Code code as follows:
Mysql> select * from sales;
9 rows in Set (0.01 sec)
SELECT name as name,Case CategoryWhen "Holiday" THEN "seasonal"When "profession" THEN "bi_annual"When '
Action command:
Copy Code code as follows:
Show Binlog events in ' mysql-bin.000016 ' limit 10;
Reset master Deletes all binary logsFlush logs produces a new Binlog log file
Show master logs; or show binary logs; View
First look at the section MySQL query article reply statement:
Copy Code code as follows:
#查询文章回复
-- ----------------------------
--Procedure structure for ' sp_select_reply_article '
-- ----------------------------
DROP PROCEDURE
BLOB data type in MySQL
A blob is a binary large object that is used to store variable amounts of data. Blob types are divided into 4 kinds: tinyblob, blobs, Mediumblob, Longblob,
The only difference between these types is that they differ in the
picture, file, binary data never put in MySQL database。Many people feel that since the database supports BLOB-type data, it's definitely not wrong to cram files into a BLOB field!? Wrong, not like this! Otherwise, in many database languages, it is
Transaction processing in various management systems have a wide range of applications, such as personnel management system, many synchronous database operations need to use transactions. For example, in a personnel management system, you delete a
PHP online import mysql large data program
";
Print_r ($data);
$data _new=array ();
$tmp =array ();
foreach ($data as $line) {$line =trim ($line);
if (strlen ($line) ==0) {continue;
} if (substr ($line, 0,2) = = '--') {continue;
} if (
This article illustrates the method of implementing object persistence layer based on MySQL database in PHP. Share to everyone for your reference. Specifically as follows:
Whim, did a bit of PHP object to the database simple persistence layer.
PHP
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