In the database system, the Union table (chain table) is an interesting application and provides a simple method.To share the data of the remote database, but it does not need to be as complex and troublesome as configuring the cluster or copying. If your databaseIf you do not have high performance requirements or need to temporarily share a remote data, consider usingMySQL Federated engine.The Federated table function of MySQL is similar to the Link
Mydumper is a lightweight third-party open-source tool for mysql database backup. The backup mode is logical backup. It supports multithreading, And the backup speed is much higher than that of the original mysql
Mydumper is a lightweight third-party open-source tool for mysql database backup. The backup mode is logical backup. It supports multithreading, And the
Android+php+mysql developing a simple example
Some time ago to do an Android project, need to use the database, before have written a little web related things, so plan to use mysql+php this gold partner, although a bit overqualified.
I am a genuine rookie, on Android do not understand, this project is purely gig, the reason why this blog is to write my project i
This article mainly introduces PHP concurrency query MySQL instance code, small series feel very good, and now share to everyone, also for everyone to do a reference. Let's take a look at it with a little knitting.
Recently in the study of PHP, like, encountered php concurrency query MySQL problem, studied, by the way leave a note:
Synchronizing queries
This is our most common invocation pattern, the clien
on the result set like a generic SQL statement.Is NULLIn the example above, all columns are set to NULL for the right table without a matching data record, so you can attach the IS null condition if you want to query this part of the record (such as a aid=4 article record in the example above, which is reflected in the lookup.):
SELECT Article.aid,article.title,user.username from article left JOIN
Friends familiar with Oracle know that when the Oracle database does not start properly, you can save data and reduce loss by dul or other tripartite tools that directly read data from data files. If you use the InnoDB engine in MySQL, you can also extract related records when the MySQL database does not start. To extract the data dictionary chapter, the following will continue to provide the drop recovery,
The following articles mainly introduce the practical application of the MySQL Character Set, including how to correctly configure the default Character Set of the MySQL database and how to view the MySQL database character set currently used by the database? 1. Configure the MySQL Default Character Set [client] defaul
Example of how to back up a MySQL database using Python: pythonmysql
This example describes how to back up a MySQL database using Python. We will share this with you for your reference. The details are as follows:
#! /Usr/bin/env python #-*-coding: UTF-8-*-# import module import MySQLdbimport timeimport datetimeimport
In the MySQL database, in fact, indexing is also a learning, a table, the index is not the more the better, but for your business is the most important. So when indexing, we should consider from the following points.
1. The smaller the index field the better, like varchar (10) is certainly better than the text type effect.
2. You need to index the field frequently as a where, group by, and order by.
3. When a federated index is to be established, a l
The following article is mainly to introduce you to the PHP and MySQL stored procedures example demo, I two days in the relevant web site to see the PHP and MySQL stored procedures Examples of the information, feel very good, it was taken out for everyone to share. Hope that in the future you will be helpful in the study.
PHP and
the transaction.Three. Lock pending viewInvolving an external lock or a table lock, InnoDB does not automatically detect the deadlock, which requires setting the lock wait timeout parameter innodb_lock_wait_timeout to resolve (the settings need to be cautious), this parameter is not only to solve the deadlock problem, in the concurrency, A large number of transactions cannot be suspended immediately with the required locks, will consume a lot of resources, or even drag across the database (defa
Php+mysql+jquery File Download Count example explained,
In the project we need to download the number of statistics files, the user every time the file download, the corresponding number of downloads plus 1, similar applications in many download stations. In this paper, the use of php+mysql+jquery, the implementation of the click File, download files, the number
rows of existing rows that have unique keys. If you do not specify any of the options, an error occurs when a duplicate key is found, and the remainder of the text file is ignored. 2.4 Separator terminated by describes the delimiter of the field by default, which is the tab character (T) enclosed by describes the enclosing character of the field. escaped by description of the escape character. The default is a backslash (backslash:) The lines keyword specifies the separation of each reco
An example of accessing the MySQL database using PHP. read an example of accessing the MySQL database using PHP, bodycenterh2PHP + MySQL example/h2h3ufontcolor = brown please input data in the text area and confirm/font/u/h3formac
setting l_done=1:
DECLARE CONTINUE HANDLER for not
FOUND
SET l_done=1;
Same as the previous example, except specified using a SQLSTATE variable rather than a named condition:
DECLARE CONTINUE HANDLER for SQLSTATE ' 02000 '
SET l_done=1;
Same as the previous two examples, except specified using a MySQL error code variable rather than a named condition or SQL State variable:
DECLARE CONTINUE HANDLER for 1329
Slow Query Optimization of MySQL is a common topic. This article describes the actual problems encountered in the production database and provides examples.
Enable slow query supportFirst, activate the slow query log, modify the my. CNF configuration file, and add the following options:Log-Slow-queries = slow. LogLong_query_time = 1---- If a patch is applied, you can specify a smaller value.Log-queries-not-using-Indexes
HoweverThen, the slow. log is c
variables only if you have super permissions. A stored procedure is simply a collection of one or more MySQL statements that are saved for later use. It can be considered as a petition, although their role is not limited to batching. In my opinion, a stored procedure is a collection of business logic and processes that can create tables, update data, delete, and so on in stored procedures. Why you use stored procedures
Simplify complex ope
This article mainly introduces the mysql transaction processing usage of pdo in php, and analyzes the usage of pdo-based transaction commit and rollback operations in the form of instances, which has some reference value, for more information about how to use mysql transaction processing in php, see the example in this article. Share it with you for your referenc
= datapath.replace (' \ \ ', ' \\\\ ')The MySQL statement needs to format the string, and the query's SQL string needs to represent the variable placeholder in%, but Python seems to have to use%s
Executemany also supports multiple data inserts at the same time, but I'm not using this because it's also convenient to recycle outside.
The following example links MySQL's TestDB database:
#!/usr/bin/python#-
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.