Since MySQL5.1.0, a feature has been added – Event scheduler Scheduler, which can be used to perform certain tasks on a scheduled basis and as a time based trigger.
First, openEvent scheduling is turned off by default and opens executable
first, export the data.
First explain your environment: Mac OS X 10.8.3, MySQL Community Server 5.6.10, MySQL Workbench 5.2.47.
I want to migrate the data in the native database to another machine, so using the Import/export function in Workbench
The results of the positioning are as follows:
Customer Environment:Windows Server 2003 R2 Standard Edition SP2MySQL Ver 14.12 distrib 5.0.18, for Win32 (IA32)Apache 2.2RisingWebshield Client 1.08
The problem has been reproduced. Can be optimized
But how do you find out which SQL statement is executing too long? Can be found through the MySQL slow log, detailed below.
First find MySQL configuration file my.cnf, according to different versions of MySQL open slow query configuration is not
php.ini file has no parameters and is not configured correctly
Workaround:
(1) Open the php.ini file and find:
Extension_dir = "./"
change it to;
Extension_dir = "X:\PHP\ext" (PHP Extender directory)
(2) Find: Windows Extensions, remove module
In the process of migrating databases from MSSQL to MySQL, based on the requirements of business logic, you need to insert 0 values in the MySQL self-added column. This is done in MSSQL:
Copy Code code as follows:
String sql;sql =
Time format for 2013-03-12
Check out the Day data:
Copy Code code as follows:
SELECT * from ' table ' WHERE date (time field) = Curdate ();
Query out the Month field:
Copy Code code as follows:
SELECT *
From ' table '
One, MySQL affairs
Only InnoDB types of data tables in MySQL can support transaction processing.
There are two ways to start a transaction
(1) using Begin,rollback,commit to realize
Copy Code code as follows:
Begin a
Reference table
Count () The number of bars used to count records
Copy Code code as follows:
Mysql> Select COUNT (*) from score;
Mysql> Select COUNT (*) from score where stu_id=901;
SUM () Sum function
Copy Code
MySQL can perform operations on data in a table, such as age by birth date, etc.
The operators include the four classes: the arithmetic, comparison, logical, and bitwise operators
Arithmetic operatorsAdd, subtract, multiply operations
Copy
Character-type data
Character data can be implemented with a fixed length or variable length string, which differs in that a fixed string of strings is filled with spaces to the right to ensure that the same number of bytes is used; variable-length
What is a view
A view is a table that is derived from one or more tables and is a virtual presence.
The view is like a window through which you can see the data specifically provided by the system.
This allows users to look at data that is useful
A subquery is nested within another query statement by nesting a query statement
Query results for inner query statements that provide query conditions for outer query statements
Because in a particular case, the condition of one query statement
Method One: Use MySQL official componentUsing MySQL to launch the MySQL connector/net component, this component is MySQL for ado.net access to the MySQL database design of. Net Private Access Components. After you complete the component, you need to
Today, a classmate gave me a response, there is a table, ID is the primary key, so that the wording can return a record:
"SELECT * FROM T has id=min (ID);"
But instead of changing min to Max, the return is empty:
"SELECT *
If the user enters a Web page and inserts it into the MySQL database, there is an opportunity to leave the security issue known as SQL injection open. This lesson will teach you how to help prevent this from happening and help protect scripts and
A transaction is a continuous set of database operations, as if it were a single unit of work. In other words, it will never be a complete transaction unless each individual operation within that group is successful. If any operation in the
So far, we've learned to get data from a table. It is simple to need, but in most realistic use of MySQL, it is often necessary to put data from multiple tables in a single query.
You can use a single SQL query from multiple tables. The join
If you want to select rows from several other tables or several rallies from a single table as a single result set row, then you can use the Union.
The Union can be used only in the MySQL4.0 version. This section explains how to use it.
Suppose
Now do the project need PHP to connect MySQL database, although learned before, but now basically forget, and then by looking for relevant information to find a solution, the following small series of specific methods to share in the cloud Habitat
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