After installing MySQL we need to be familiar with the basic operation of MySQL, this article mainly introduces the database and table additions and deletions, as well as indexes, transactions, views.First, MySQL database and table creation and
It is normal for the production environment to mistakenly operate in MySQL, so it is necessary to use the incremental backup of MySQL for recovery.Incremental backup is a common use, it can specify a wrong operation time and location point for data
1) Add three elements:1, to which table to add the row: Add to Class table2. Add a few columns (ID sname gender,company,salary,fanbu)3, respectively add what value (1, ' Zhang San ', ' male ', ' haha ', ' 6666.66 ', 666)INSERT into class (ID sname
1. Create a new user
1.1 Log in to MySQL:@>mysql-u root-pbr/>@> Password1.2 Create User:mysql> INSERT INTO Mysql.user (Host,user,password) VALUES ("localhost", "Test", Password ("1234"));This creates a user named: Test Password: 1234Note:
Symptoms every time you remove the MySQL container restart no two minutes and report the wrong title
df-h command to view the application of each mount space discovery Root home var three files directory the space is full.
Baidu on the Internet
1. Try to avoid using the! = or <> operator in the WHERE clause, or discard the engine for a full table scan using the index.2, to optimize the query, should try to avoid full table scan, first of all should consider the where and order by the
Error code:CMake Error at cmake/boost.cmake:81 (MESSAGE):You can download it with-ddownload_boost=1-dwith_boost=Workaround:1. Create a folder named Boost under/usr/localMkdir-p/usr/local/boost2. Go to this newly created folder and download boostwget
MySQL full backup + incremental backup
Profile:
Manage MySQL configuration file, open Binlog log
for MySQL database:
Log_bi n =/var/log/mysql/mysql_bin.log
server-id = 1 (must
Because of some default settings in the project, and for various reasons, MySQL database needs to be developed in a non-strict mode (the most recent version of MySQL is turned on in strict mode by default).Under Linux MySQL service, the following
Tool Library InstallationPip Install PymysqlConnect to shut down the database and increase the deletion check operation#Import Pymysql LibraryImportPymysql#Open a database connection#parameter 1: Host + port number where database server
the step problem of MySQL self-increment column
Unique index and Federated unique
Variants of foreign keys
SQL data row additions and deletions change
View
Trigger
Function
Stored Procedures
Transaction
# database Layer Permission record locationTable-level permissions are recorded in the Mysql.tables_priv table.([email protected]) [mysql]> ([email protected]) [mysql]> desc tables_priv;+-------------+--------------------------------- ---------------
Rights ManagementWe know that our top authority manager is the root user, and it has the highest permissions. Includes select, Update, delete, update, Grant, and so on. So in general, after the company, the DBA engineer creates a user and password
Compiling the installation database (MySQL)First download the MySQL tar package,www.mysql.com DownloadI'm using mysql5.6.41 's tar package.Put the bag in the/usr/local directory.useradd -s /sbin/nologin mysql 创建mysql用户mkdir -p /data/mysql/data
MySQL database common operation one, MySQL General Command 1) displays the current database version number and date.MariaDB [(none)]> select version(),current_date();+----------------+----------------+| version() | current_date() |+-------------
This section focuses on:
How to find the relationship between two tables
Three types of relationships in the table
First, IntroductionBecause of the constraints of foreign key, the two tables form three kinds of relationships:
1. To optimize the query, to avoid full table scanning, first consider the where and order by the columns involved in the index.2. Avoid null-valued fields in the WHERE clause, which will cause the engine to discard full-table scans using the index,
1, need Mysql-linux installation packageThis time use mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz to install2. Upload this installation package to a Linux serverThe upload path is:/usr/local3. Unzip MySQLinput command:tar zxvf mysql-5.7.17-linux-glibc2
---restore content starts---Loop looplabel:loop statement_list IFthen LEAVE label; END IF END LOOP label;View CodeRepeat cycleREPEAT END REPEAT;View CodeWhile loop while search_condition do statement_listENDwhile;View
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