1. Test environment
Os:linuxdb:mysql-5.5.18TABLE:INNODB Storage Engine
The table is defined as follows:
2. Test scenario and analysis "number of records Group_message"
(1) Select COUNT (*) method
(2) Select COUNT (1) method
(3) Select
See if the event is open
Copy Code code as follows:
Show variables like '%sche% ';
To open an event plan
Copy Code code as follows:
Set global Event_scheduler = 1;
Create stored Procedure test
Benefits of MySQL using partitioned tables:
1, you can put some of the data in the collation of a partition, you can reduce the number of server check data to speed up the query.2, easy maintenance, delete the old data by deleting the partition.3,
Colleagues report a strange phenomenon, a simplest test of PHP code, in the test environment is normal, but in the formal environment, regardless of the way (TCP/IP, UNIX sockets) can not connect to MySQL.
I helped to view the next, indeed, whether
In MySQL, a table with the InnoDB engine type supports foreign key constraints.Use conditions for foreign keys:1. Two tables must be INNODB tables, MyISAM table temporarily does not support foreign keys (it is said that future versions may be
The MySQL UDF (user Defined Function) is similar to an API that allows users to write a set of functions (UDF) in C + + (or a language using the C call specification) based on certain specifications, and then compile it into a dynamic link library,
Generally, updating the MySQL configuration my.cnf requires a restart of MySQL to take effect, but sometimes MySQL is on the line and does not necessarily allow you to reboot. Look at an example: mysql> show variables like ' log_slave_updates ';
Just today friend XJB also encountered this problem, so wrote this note, the description of the problem and the resolution record.
Problem Description: Web way, you can link MySQL, but at the command line, but prompted:
Fatal error:undefined
PHP saves the session by default in the way the file is saved, which is only available on Windows with a very small space overhead, but if we use Uinx or the file system on Liux, the file space overhead of such a file system is very large, However,
MAC Local Environment Build
In the Mac system, we can use Mamp Pro software to build the local server. Install this software, the site directory in the/applications/mamp/htdocs folder, just put the file into the folder, you can access through the
Write a test of MySQL PHP file is as follows:
Copy Code code as follows:
$link =mysql_connect (' localhost ', ' root ', ' root ');
if (! $link) echo "Failed!";
else echo "Success!";
Mysql_close ();
?>
Results reported
Query string length in MySQL:
Length: is a calculation of the lengths of a field a Chinese character is counted three characters, a number or letter is counted as a character
The Char_length (str) return value is the length of the string str, and
The following is a reprint of the MySQL millisecond, microsecond precision time processing two paragraphs, left for themselves and for everyone to reference ~ ~MySQL gets milliseconds, microseconds, and milliseconds, microseconds processingMySQL
mysql> Load Data local infile '/root/bao/pingtaizhangwumingxi/20170206_zwmx-pt-rmb_297308.csv ' into table platform_ Billing_details fields TERMINATED by ', ' LINES TERMINATED by ' \ r \ n ' Ignore 1 LINES;Linux uses shell scripts to bulk import CSV
I. Numeric typeMySQL supports all numeric types in standard SQL, including strict data types (integer,smallint,decimal,numberic), and approximate numeric data types (float,real,double presision). and expand on this basis.The extension adds
Transferred from: http://www.cnblogs.com/kissdodog/p/4173337.htmlMySQL is divided into regular users and root users. These two types of users have different permissions.First, the Authority tableWhen you install MySQL, a database named MySQL is
The sample SQL statements for exporting CSV format data in MySQL are as follows:SQL code
SELECT * FROM test_info
into outfile '/tmp/test.csv '
Fields terminated by ', ' optionally enclosed by ' "' escaped by '" '
How to install mysql separately in mysql7.x, and install mysql in mysql7.x
The yum source of CentOS7 does not seem to have MySQL by default. To solve this problem, we need to download the mysql repo source first.
1. Download the mysql repo Source
$
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