One of the prerequisite skills for database performance optimization when using indexes. In the MySQL database, there are four kinds of indexes: the focused index (primary key index), the normal index, the unique index, and the full-text index
Describe
Specification
Example
Link Database
Mysql-u User name-p password
Mysql-uroot-proot
Exit database
Exit,quit,ctrl+d
*
Show Database version
Select version ();
*
Method 1: Use the Set password commandFirst log in to MySQL.Format:mysql> set password for user name @localhost = password (' new password ');Example:mysql> set password for [email protected] = password (' 123 ');Method 2: Use MysqladminFormat:
Common operations for MySQL under Linux:
Display Databaseshow databases;
Select DatabaseUse database name;
Displaying tables in a databaseShow tables;
Show the structure of a data tabledescribe table name;
Show records in a tableSELECT *
First, database management system1. RDBMS relational database features① Two-dimensional table② Typical products Oracle traditional enterprise, MySQL is the Internet Enterprise products③ data access via SQL④ the greatest features, data security is
Difference:1. InnoDB support transactions, MyISAM is not supported, for INNODB each SQL language is encapsulated as a transaction by default, auto-commit, which affects speed, so it is better to put multiple SQL language between Begin and commit,
1, use distinct to weight (suitable for querying the total number of the whole table)There are multiple schools + teachers to contribute, need to count the total number of authorsSelectcount (author)As total from files each author has a lot of
★ Programming OptimizationOne, character encoding (MySQL console garbled output resolved: character_set_results= ' GBK ')Table/Column encoding settingsColumns: ALTER TABLE name change column list name data type character Set character set nameTable:
Go locally and use the cmd command to connect to MySQLMysql-uroot-prootExecute the following command to open Data remote link permission (the first root refers to the user; the second root refers to the password)' Root '@'%'root' with GRANT
1. MySQL master-Slave synchronization configuration 1.1. Basic informationDatabase master server ip:127.0.0.1Database from server ip:192.168.1.311.2. Primary server configuration file My.ini configuration (Master)[Mysqld]#打开日志 (the host needs to
I. BACKGROUNDResc table preserves the system's first-level, two-level functional modules, while preserving the function of the two-level function module pages, the PID defines the parent-child relationship.Want to through the Resc table, sorting out
In the incremental deployment of the system, often need to provide incremental modification of the script, if it is to modify the stored procedures or custom functions, it is good to change, do not worry about the table function to be affected.What
One. Isolation level:The SQL standard defines 4 isolation levels, including specific rules that define which changes within and outside a transaction are visible and which are not.Low-level isolation levels generally support higher concurrency
Method 1: Use the Set password commandFirst log in to MySQL.Format:mysql> set password for user name @localhost = password (' new password ');Example:mysql> set password for [email protected] = password (' 123 ');Method 2: Use MysqladminFormat:
At the time of creationCREATE TABLE si (Id INT auto_increment)Automatic numbering, can not have more than one automatic column (can be automatically coded for you)If you add a column to it in a S11 form (this is not the same as inserting data)ALTER
1. Views ViewA view is a virtual table whose contents are defined by a query. A filter that defines a view can come from one or more tables or other views of the current or other database.Advantages of the View:① simplifies operations by defining
Transfer from https://www.cnblogs.com/wsl222000/p/5445768.html1. Installing the mysql-5.5 Yum sourceRPM-IVH http://repo.mysql.com/yum/mysql-5.5-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpmTo install MySQL5.6, you can
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