Command preparation
Create directory
Mkdir directory name
Chmod 777 permission for directory name change
Add startup Item Service
Chkconfig -- add php-fpm
Chkconfig nginx on
Searching for file locations is often used to find various configuration
1. Create Table
Create table (
Name char (20) not null,
Id char (20) not null primary key );
2. Create Table B
Create table B (
B _name char (20) not null,
B _id char (20) not null,
Constraint foreign key (B _id) references a (id) on delete
Run the df command to check whether the disk is full. Because the system default partition is used at that time, I don't know why I cannot resize it automatically! We will handle this issue later! :Copy codeThe Code is as follows: [root @ snsgou ~] #
I. Data Tables
To ensure data integrity and consistency, you must specify the field name, field type, and field attribute when creating a table. Constraints, indexes, and ), primary key and foregin key.
Constraints:
Not null non-empty
In projects, you sometimes need to test the database performance or to test the paging effect. If one piece of data is inserted, the efficiency is obviously very low. The SQL statements added in batch are:
Insert tableName (name, password) select
Description of the EXPLAIN column:Table: displays the data of this row about which tableType: this is an important column that shows the type used by the connection. The connection types from the best to the worst are const, eq_reg, ref, range,
Connect C ++/C to the MySQL database in Linux (2) -- return data SQL reference:
The SQL statement that returns data is used to retrieve data records that meet the conditions from the database.
There are four steps to retrieve data from the MySQL
Originally, LAMP programmers had to use the help of the operating system to complete some periodic database operation tasks, such as Windows scheduled tasks or Linux contab. MySQL5.1 has finally added the Event Scheduler function, which allows you
The slow log in mysql is a log tool used to record SQL statements that have been executed for a long time (beyond long_query_time seconds.
Enable slow log
Set in my. cnf
[mysqld]
slow_query_log=on
slow_query_log_file=mysql-slow
Restart
The developer writes a view. It takes 30 minutes for the select statement to be optimized. The view is as follows:
It may take more than 30 minutes for a developer to select:
21068 rows in set (1987.08 sec)
First, parse the following:
Mysql>
The default Character Set of installed MySQL is latin1. To change the character set to what you need (such as utf8), you must change the related configuration file; in linux, the default installation directory of MySQL is distributed in different
Solution
When mysql is running, temporary files are automatically generated in the temp folder under the windows folder on drive C. These files are not large, but the number of files is very large, there may be hundreds of thousands of files in a
Because the data directory of the database is under/var/lib by default when mysql is installed in yum, it needs to be moved to the/data Partition for data security considerations. The procedure is as follows:1. Disable apache and mysql.Copy codeThe
1. Speaking of mysql, we immediately think of its small size, fast speed, and open source features, so it is widely used. Today, we will summarize the two most frequent mysql operations: insert and query, and the optimization methods.
2. insert:
3.
Basic knowledge1. mysql compilation and Installation2. How to install and configure the mysql 3rd storage engine3. Features of mainstream mysql storage engines (MyISAM/innodb/MEMORY)4. String encoding knowledge5. MySQL user account management6. Data
In this case, mysqldump may be difficult to solve. The following method can be used to solve this problem.Method 1: Use insert and select in combination
1. Create a new table, such as new-table, containing the name of the field to be exported, such
Here I will only talk about some issues related to MySQL database installation.I have installed MYSQL before. It seems that I do not need to start the service manually, but I forgot to install the service manually. If mysql is not available just now,
Solution 1:1. Enter mysql> Status2. Select mysql database: mysql> use mysql;3. Change user table data: mysql> update user set password = password ('new password') where user = 'root ';4. Activate permissions: mysql> flush privileges;5. Exit mysql:
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