Example:
A field (purview) in the User table represents the permission of the user.
Store all user permission IDs in this field. For example, you have five permissions: 1, 2, 3, 4, and 5.
Find which users have the permission Id 1
CopyCodeThe
Step 1: Define the backup directory on your Linux Server:
CopyCode The Code is as follows: mkdir/var/lib/mysqlbackup
CD/var/lib/mysqlbackup
Step 2: The following is the most important step: Write a regular backup script.
Copy code The
Everything comes from an experiment. See the following example:
Table:
Copy codeThe Code is as follows: create table if not exists 'foo '(
'A' int (10) unsigned not null AUTO_INCREMENT,
'B' int (10) unsigned NOT NULL,
'C' varchar (100) not
I,Partition Concept
PartitionAllows you to allocate multiple parts of a single table across file systems based on specified rules. Different parts of a table are stored as separate tables in different locations. MySQL supports Partition from 5.1.3.
When multiple mysql statements are connected, such
$ Sqls = "insert table a values (1, 2); insert table a values (2, 3 );"
You can use three methods in php to execute the command:
Mysql_query
Pdo
Mysqli
Three methods are available when sqls
1. Update
1
Sudo apt-get update
2. Install nginx
1
Sudo apt-get intsall nginx
After Ubuntu is installed, the file structure is roughly as follows:* All configuration files are under/etc/nginx, and each virtual
I. PreparationsTo develop MYSQL extensions, you must install MYSQL first.Download mysql-essential-5.1.65-win32
The red option must be selected because the header file and MYSQL dynamic library are required during mysql extension development.
We usually see mysql tutorials and mysql tool books on the Internet, which contain cmd commands and result sets.Some beginners may not know which corner of the system to enter these commands, or start some mysql tools. The following describes how to
If you are not interested in the long article, you can also look at the results directly. Maybe you are interested in the results. In practical applications, after storage and optimization, the query response speed can be controlled within 1 to 20
Cause analysis:Host 'local' is not allowed to connect to this MySQL server typical remote permission issues.Problem:
MySQL does not have the permission to enable remote logon. It depends on the system used by your server, such as linux or Windows.
The time format is 2013-03-12.
Query the data of the current day:
Copy codeThe Code is as follows: SELECT * FROM 'table' WHERE date (time field) = curdate ();
Query the current month field:Copy codeThe Code is as follows: SELECT *FROM
Poor Optimization of nested queries
As mentioned above, join table queries are more effective than nested queries without special considerations. Although the two queries share the same meaning, even though your plan is to tell the server what to do
This is the case: there are two tables, team table and people table. Each people belongs to a team and there is a field team_id in people.
The following table creation statement is provided:
Copy codeThe Code is as follows: create table t_team
(
Id
On a PHP page, there is a browser count of 200 concurrent queries per second, which causes a lot of pressure on mysql due to insert.
In the lnmp environment, other page content is cached, and there is not much load. This is the browser statistics
1. if many rows are inserted from the same client at the same time, use the INSERT statement containing multiple values to INSERT several rows at the same time. This is faster than using a single-row INSERT Statement (several times faster in some
The searchd daemon of sphtracing supports MySQL binary network protocol from version 0.9.9-rc2 and can be accessed through standard MySQL APIs.For example, the "mysql" command line program can work well.
The following is an example of using the
1. It may be that the/usr/local/mysql/data/rekfan. pid file has no write permission.Solution: grant permissions, execute "chown-R mysql: mysql/var/data" "chmod-R 755/usr/local/mysql/data", and then restart mysqld!
2. the mysql process may already
Dump is performed at every day to back up the corresponding database, and binlog files of the corresponding database are updated.If a database error is found, you only need to recover the previous dump backup and then restore the binlog file of the
1. view the current character set:
Copy codeThe Code is as follows: show character set;
2. Delete mysql related directories
Copy codeThe Code is as follows: rm-rf/usr/local/mysql/* installation directory
Rm-rf/var/lib/mysql database directory
3.
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.