Transferred from: http://www.cnblogs.com/exmyth/p/3303470.html14.1.1 Creating a stored procedureIn MySQL, the basic form of creating stored procedures is as follows:
CREATE PROCEDURE sp_name ([proc_parameter[,...]])
[Characteristic ...]
MySQL master-Slave synchronization architecture is currently one of the most used database architecture, especially the load is relatively large site, so for master-slave synchronization management is very important, novice often in the case of
Database connection and shutdown: Mysql-h Server host address-u user name-P user Password
Create a new user and authorize: Grant permissions on the database. Data table to username @ Login host identified by "password"
Creating database:
Data structure optimizationOne, select the format of the data typeThe choice of data type, focusing on the appropriate two words, how to determine whether the selected data type is appropriate?1. Use the smallest data type that can save your data.2,
The first scenario:The use of recursive algorithms is also the most frequently used, most open-source programs are the same, but generally only use the level four classification. The database structure design of this algorithm is the simplest. A
About MySQL OptimizationBecause the page static technology can realize the cache of dynamic data, sometimes it is necessary to request the database. Therefore, the optimization of the database is also indispensable.Optimization ideasDesign: Storage
Using MySQL for authentication?1th step: Download the MySQL authentication module and rename it to mod_auth_mysql.so file, and save it in Apache modules directory2nd step: Apache to load this function moduleLoadModule the directory where the module
issue: Encounter MySQL startup prompt access denied for user [email protected] (using Password:yes)1, check the password there is no error, if none is a permission problem.2. Open the SQL Graphics tool and enter the following command lineGrant all
The most affected speed in MySQL is those with very slow queries. These slow statements may not be reasonable enough to write, or a joint query of multiple tables under Big data, and so on. So we need to find these statements, analyze the reasons,
The reason for poor query performance is that too much data has been accessed
All columns are returned when a multi-table connection is made
select * from sakila.actor inner join sakila.file_actor using(actior_id)inner join sakila.film
Create a REPL account on master for replication.Grant Replication Slave on * * to ' repl ' @ ' percent ' identified by ' [email protected]$ $W 0rd ';Flush privileges;The difference between MySQL master and slave is built under windows:Binary log
1. Inner Connection(A typical join operation, using a comparison operator like = or <>). Includes equality joins and natural joins.Inner joins use comparison operators to match rows in two tables based on the values of the columns that are common to
To export MySQL query results as CSV, you will typically use PHP to connect to MySQL to execute the query, and then export the returned query results using PHP to generate CSV format.But this is more troublesome, requires the server to install PHP
MySQL has the following types of logs:Error log:-log-errQuery log:-logSlow query log:-log-slow-queriesUpdate log:-log-updateBinary log:-log-binWhether the log is enabledMysql>show variables like ' log_% ';How to know the current logMysql> Show
MySQL single-column index and federated indexAll MySQL column types can be indexed. The use of indexes on related columns is the best way to improve the performance of select operations.A table can have a maximum of 16 indexes. The maximum index
The change buffer is a special data structure, caches changes to secondary index pages, affected pages The buffer pool. The buffered changes, which may result from INSERT, UPDATE, or DELETE operations (DML), is merged later when the pages ar e
Navicat is A visual interface tool for MySQL, which is very intuitive to use. The following is the use of Navicat. The first step is to install Mysql :1, in Baidu search download Mysql, to download;Or go directly to orcal 's website for
Database subquery, database subquerySubquery
A select statement also contains another select statement, in which the select statement is called a subquery.
Subqueries can be divided into the following categories based on the position where select
Mysql random query record set and mysql query record
Sometimes, you need to randomly query several record sets from the database. After searching online, several blog posts are repeated ..... I don't know who copied them. Apart from introducing a
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