Data: A db,2000 table, 2000 Tabular data, 30 column per record, and an average of 4.3w records per sheet, totalling 86,388,670 records.
Machine: Linux 64bit 8G memory 4 core Intelx3320@2.5ghz
Basic ideas:
Copy Code code as follows:
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
The constant global event_scheduler of MySQL must be on or 1 for the timer to function.
--See if the timer is turned on
Show VARIABLES like '%sche% ';
--Open Timer 0:off 1:on
SET GLOBAL event_scheduler = 1;
--Create Event
--Automatically calls
First of all to declare: Under normal circumstances, to modify the MySQL password, authorization, is required to have the root of MySQL permissions.
Note: This operation is at the win command prompt, phpMyAdmin is also applicable.
User: Phplamp user
If you are accustomed to using Windows database, that is, in the graphical interface to manipulate the database, then when you operate on the command MySQL will be unfamiliar, in fact, as long as you master some basic commands, and often used,
1.order by Rand ()The data is very slow, the randomness is very good, suitable for very small amount of data.
Copy Code code as follows:
SELECT * FROM table_name as R1 JOIN (select ROUND (RAND () * (select ABS (MAX (ID)-min
RegexpExample 1. The query field contains data that is not in English
Copy Code code as follows:
SELECT *
From ' M_user '
WHERE ' Emp_no '
REGEXP ' [^-~] ' =1
Column 2. So I can get all the English-free
Copy Code
The day before yesterday because the work required me to take a random few records from a database of 5W records, here I am directly using the MySQL rand by function to direct, thousands of records okay, but if the tens of thousands of feeling to a
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
One
The following parameters in the php.ini are preceded by the ";" Remove:
Copy Code code as follows:
; Extension=php_dba.dll
; Extension=php_gd2.dll
; Extension=php_mbstring.dll
; Extension=php_mcrypt.dll
;
This example realizes the communication function of the client through thinkphp combining Ajax with MySQL, as follows:
1, using JS Ajax local refresh function, each refresh the database read out of the new record inserted into the page display area,
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
Baidu has consulted some information, and combined with some of its own experience, the following solutions are adopted:
Copy Code code as follows:
$idlist = ';
For ($i =1 $i if ($i ==1) {
$idlist =mt_rand (3,25216);
}
else{
$idlist =
A recent study on C + + connection database.
When MySQL is installed, the Include folder under its installation directory does not find Libmysql.lib.
This has been studied and found to be due to the fact that when MySQL is installed,
There is no
MySQL MySQL lost connection to server during query problem resolutionReason: In the query MySQL database, or modify the larger table when this situation occurs;Google's:Programme 1. Add a row of settings skip-name-resolve under the MySQL profile
Import java.sql.*;
Import Java.text.DateFormat;
Database query public class Selecttable {String dbdriver= "com.mysql.jdbc.Driver";
String dburl= "Jdbc:mysql://localhost:3306/sss"; Change string username= "root" according to the actual
1. Open the terminal, input: cd ~
Will enter the ~ folder
2. Then enter: Touch. Bash_profile
When a carriage return is executed,
2. Re-enter: Open-e. bash_profile
This file is opened in TextEdit (if you have not previously configured an
Today, a friend asked me how to optimize MySQL, I follow the thinking of a bit, probably rough can be divided into 21 directions. There are some details (table cache, table design, index design, program-side caching, etc.) first, for a system, the
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