There are a lot of MySQL variables, some of which are worth our attention, and here are some examples of MySQL variables that are worth learning.1 threads_connectedThe first thing to note is that the value of this variable cannot be show variables
One account Management1 Create an account:Example 1:Set up account ZWJ with all permissions on all databasesMysql> Grant All on * * to ' zwj ' @ ' 192.168.154.180 ';Query OK, 0 rows affected (0.01 sec)Set a password for ZWJMysql> Grant All on * * to
MySQL daily operation Command:show databases; View DatabaseCreate Database test_db; Create a database named test_dbUse test_db; Enter the test_db database.Show tables; See how many tables are in the database.CREATE TABLE test01 (ID varchar (), name
1. Can be opened by executing an SQL statement, but only valid for the current connection, here is the SQL statement:Set sql_mode= "Strict_trans_tables,no_auto_create_user,no_engine_substitution";2. By modifying the MySQL configuration file, look
Extract the corresponding count number (MyCount) according to the appropriate conditionsTotal count (totalcount)Calculated percentage: Mycount/totalcount * 100Rounding: Using the ROUND function ROUND (number, the decimal place to keep), ROUND
Http://www.cnblogs.com/wyzs/p/6762452.htmlMySQL data import and export this way can quickly realize the fast import and export of millions level data.(Operation only on server, operation fails when file exists)
Export to file (SELECT INTO
Because of the paging mechanism of MySQL: instead of skipping offset lines, take offset + n rows, then return to discard the previous offset line, return n rows ,Therefore, when offset is particularly large, the efficiency is very low, either
For example, to modify the field username in the table user to name:ALTER TABLE User VARCHAR (a);Other Modifications to table field information:1. Add Field: Add field to table user password after ID;ALTER TABLE User ADD COLUMN VARCHAR (notNULL
First, the query cache descriptionMySQL query cache is used to cache the SELECT statement we execute and the result set of the statement, and MySQL is similar to typical KV storage in the specific technical details of implementing the query cache,
1. Install the database service (install MySQL) and create the database (management) that needs to be synchronized2, modify the main server's configuration file, set the synchronization database and the different database, modify the need to restart
Create and use a database
To view the database on the server:SHOW DATABASES;
To create a database:CREATE DATABASE ;
Indicate what database to use:USE
Create and use a table
To create a table:CREATE TABLE ( ,...);
Recently the project has used MySQL, the project has no OPS, the project manager told me to use Linux under the basic environment, which encountered a variety of pits, now record, convenient for later.The following content is from the online excerpt,
Mysql for DatabasesPreparation
Ubantu system, navicat for mysql softwareIntroduction
Mysql is designed based on the c/s communication architecture. Users interact with the server through the client, and the server operates on the database. Simply
Mysql Import and Export SQL files (including database and data table operations), mysql Import and Export
Let's just get started.
Log on to mysql under the windows command line, create a database test_01, create a user table, and insert a piece of
Set the password for the mysql installation-free version.
Method 1: use the set password command
MySQL-u root
Mysql> set password for 'root' @ 'localhost' = PASSWORD ('newpass ');
Method 2: Use mysqladmin
Mysqladmin-u
Mysql optimizes the query speed when processing massive data.
In actual projects, it is found that when the data volume of the mysql table reaches the million level, the query efficiency of common SQL statements decreases linearly. If there are many
MySQL comma-separated fields are converted to rows, and mysql comma-separated fields are converted to rows.Preface:
Many business tables use a design pattern that violates the first paradigm due to historical or performance reasons. That is,
Mysql 5.7, mysql5.7
As the data stored in the MySQL database grows, the original storage space has been fully occupied, resulting in the connection failure of mysql. Therefore, you must place the stored data in another place. The following are some
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