Discover database book principles practice using mysql, include the articles, news, trends, analysis and practical advice about database book principles practice using mysql on alibabacloud.com
Different from row-level or page-level locking options:· Version (for example, the technology used to insert data in MySQL in parallel), which can be a write operation with many read operations at the same time. This indicates that the database or table supports different views of Data Dependencies, depending on the Access time. Other common terms are "time tracking", "Write replication", or "On-Demand repl
As a programmer, it is often necessary to import and export data between different databases to save data entry time. Next I will share with you how to import data from the ACCESS database to the mysql database.
First of all, I would like to explain some ideas. There are many ways to import mysql, but access is not in
can't be defined, but it can change its value.What global variables are queriedShow variables;//shows all the global variablesShow variables like ' char% ';? Fuzzy matching QueryQuery a single global variable cannot be used with show, should use SelectSELECT @ @character_set_client;Assign a value to a global variable:SET @ @character_set_client = GBK;?? Valid only in the current link (that is, the current client)1.7.2 Session variable br/> session variable starts with @Set @vall = 10;Must you s
Label: 1,show processlist View the status of the table in the database, whether it is locked; Kill ID//kills locked table =================================================== Set autocommit=0; SELECT * from t1 where uid= ' xxxx ' for update//is a row lock in the case of an index (e.g. UID), otherwise it is a table lock INSERT into T1 values (1, ' xxxxx '); Commit ===================================================== Lock tables T1 write|read; INSERT in
scan the entire table frequently, it is much slower than other locks.
· With high-level locking, you can easily adjust applications by supporting different types of locking because the lock cost is lower than Row-level locking.
In the following cases, table locking takes precedence over page-level or row-level locking:
· Most of the table statements are used for reading.
· Read and update strict keywords. You can update or delete a row that can be extracted with a single read Keyword:
? UPDATE
This is a good mysql database optimization article I have seen on the Internet. The content is full!1. Use indexes to traverse tables faster The index created by default is a non-clustered index, but sometimes it is not optimal. In a non-clustered index, data is physically stored on the data page randomly. Reasonable index design should be based on the analysis and prediction of various queries. Generally s
Label:CentOS6.7 using a non-root user (normal user) compile and install the MySQL database and implement the MySQL database service random auto-start using the Shell Script timed task mode1. About
;Do not perform column operations in the index;InnoDB the primary key is recommended to use the self-increment column (the primary key to establish the clustered index, the primary key should not be modified, the string should not be the master key) (Understand the InnoDB index preservation structure to know);No foreign keys (guaranteed by the program);4. SQL class principle SQL statements as simple as possible (a SQL can only be in a CPU operation, large statements to split small statements, re
use an index with a small amount of dataIf the value of the index is long, the speed of the query is affected. For example, full-text retrieval of a field of type char (100) would take more time than a field of type char (10). 6. use prefixes as far as possible to indexIf the value of an indexed field is long, it is best to index it with the prefix of the value. For example, text and blog type fields, full-text retrieval can be a waste of time. If you retrieve only the first few characters of a
' (' user_id '), KEY ' Puidid_index ' (' puid ') ENGINE=InnoDBAUTO_INCREMENT=10DEFAULT Charset=utf8comment= ' Recruitment review sub-table 99 ' Due to the large amount of Comment table data, in advance to make a table, according to the post Puid divided into 100 sub-tables, then the current detail page involves SQL as follows: SELECT * FROM Wanted_post where Puid=xxxx;select * from wanted_post_comment_99 where puid=xxxx; This is a simplified model, a lot of comments, but also related to pagi
, format: 2014-09-18 08:42:30
Timestamp
4 bytes, automatically stores the time the record was modified
Year
1 bytes, year
Integral type
MySQL data type
Meaning (Signed)
tinyint
1 bytes, range ( -128~127)
smallint
2 bytes, range ( -32768~32767)
Mediumint
3 bytes, range ( -8388608~8388607)
Int
4 bytes, r
total number of records in the table, 0 Suppose you want to establish an index of last_name, first_name, gender three columns. T (last_name) = select count (distinct last_name)/count (*); T (first_name) = select count (distinct first_name)/count (*); T (gender) = SELECT COUNT (distinct gender)/count (*); Obviously, last_name and first_name should be placed in front of the index (the actual situation is the main) EndLearn about common indexing strategies and query techniques, but how do you appl
Can I convert a mysql database into a desktop database when PHP is used as a website using a mysql database? I developed a PHP-language Enterprise website using the
manipulate all the tables on the server.--The user address can be localhost, or it can be an IP address, a machine name, and a domain name. You can also use '% ' to indicate connections from any address.--' connection password ' cannot be empty, otherwise the creation failed. Password The password set by the representative; Example Grant all the permissions for all tables of all databases to the IP for any value user named Test password for PWD GRANT all on * * to ' test ' @ '% ' identified by
database should be very flat, and you can verify how flat a B + tree in InnoDB is by inserting enough data into the table sequentially. We create a test table with a simple field from the CREATE statement in the following figure, and then keep adding data to populate the table. A few intuitive conclusions can be analyzed by using the statistical data of the following graph (sources see reference 1), and th
that nearly 3W employee ID with duplicate values, but we still don't know the reason for the repetition, now we need to filter out the complete information by repeating the employee ID. SELECT *
from dept_emp
WHERE inch (SELECT emp_no
from dept_emp
GROUP by emp_no
having COUNT (EMP_NO) > 1
) Now the results are clear, they are the department! So the table record is the true meaning of the data is the time span each employee has to spend in each department. But at the same time, there i
Practice has proved that the use of cursors in a database is better. There are two tables in the database, one of which is huge, with about 10 million records (Big) and the other with only 5000 records (small ).
Currently, the table Big needs to be updated based on the table small.
UPDATE Big SET Bf1 = 0 WHERE BigId IN (SELECT BigId FROM Small WHERE Sf1> 0)
Have nothing to do, find a practice to write at work, the contact topic is for SQL Server 2000, the following MySQL
One word explanation (2 points/a) 34 points
Data data Database RDBMS relational database management System grant authorization
REVOKE deny deny permission DECLARE define variable procedure stored procedur
There are two different ways to add users: using the GRANT statement or directly operating the MySQL authorization table. The better way is to use the GRANT statement, because they are more concise and seem to have fewer errors. The following example shows how to use a MySQL client to install a new user. These examples assume that the permission has been installe
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.