1. Log in to MySQL statementMysql-h hostname|hostip-p port-u username-p databasename-e "SQL statement";2. Create a new normal userCREATE USER [email protected] identified by ' password ';INSERT into Mysql.user (Host,user,password) VALUES (' hostname
Data type (column type) The so-called data is strong, is a unified classification of data. From the system point of view, in order to be able to use a unified approach to management, better use of limited space.The data types in SQL are divided
1. Basic Enquiry: (1) I only want to query a column of a table: SELECT col1,col2 from table1 filter out the column fields; (2) When I want to query the information of a row: use where col1=1 and col2=2 to filter out the rows; (3) We can use GROUP by
Sorting results in slower performanceOptimization strategy: 1. Try not to use sort 2. Only the results of the index are checked and the internal connection querySelect bizchance0_.* from Biz_chance bizchance0_, Biz_bizcustomer bizbizcust1_where
1.master.info fileLocated at the slave end of the data directory, storage slave connected to master information, such as the master host address, connection user, password, port, the log information has been obtained.The Master.info file is modified
MySQL security tips, will be slowly added later.MySQL command line has a parameter-U,--safe-updates only allow to UPDATE and DELETE that uses keys.Indicates a security update, that is, delete or update data, you must add the conditions, or error.
The following summarizes some of the most common examples of SQL optimization, although relatively simple, but very practical, I hope to be helpful to everyone. SQL optimization is generally divided into two categories, one is the optimization of
Be sure to remember reset before restoring from the library, because restarting MySQL does not affect the replication process, and if you forget reset, it will cause you to recover while the main library has actions to write from the library, when
Clear Table DataTRUNCATE table ' name ';Shrink table Space table ' name ';Note: This action is only valid for tables that have a separate tablespace, and is often used to perform the removal of large amounts of table data because the table space
MySQL Database storage engineMySQL database is a relational database, where data is stored in a single table in a database, each table is associated with each other, each row in the table is related, and each column is irrelevant. This is the basic
1. Add Default-character-set=utf8 to the [client] field as follows:[client]port = 3306socket = /var/lib/mysql/mysql.sockdefault-character-set=utf82. Add Character-set-server=utf8 to the [mysqld] field as follows:[mysqld]port = 3306socket =
Three tables, fields and data are as follows, and for simplicity all is shaping:zzz_repair:== Repair Order Form: order number, Provincezzz_repair_goods:== "Maintenance commodity table, order number, product name, number of goodsZzz_sell: = = "Sales
Relational database concepts:1. What is a relational database? Relationship Type database: A database built on a relational model (mathematical model)Relational model: A model that is so-called based on relationships.The relational model consists
Mysql-SQL advanced application, mysql-SQL applicationAdvanced SQL languageTypical operations
Order
- select * from play_list order by createtime;- select * from play_list order by bookedcount desc,createtime asc;The order by statement is used to
Mysql user password modification, user addition, deletion, and permission setting, mysql user password Modification
The username and password used in the following example are: test, 111111
MysqlPassword modification:
Mysql requires the root
Mysql5.7 installation, mysql5.7.9 installation tutorial
For more information about installing mysql 5.7 in windows
Note:
After installing mysql 5.7, the ROOT account has the default password, which can be found in mysql in windows. under the data
MySQL Limit order by, mysqllimit
When I write a fuzzy query today and sort by time and pagination, there is such an SQL statement in the ing file of mybatis.
1 SELECT 2 3 FROM USER U 4 WHERE U.status !=
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