Take the example of creating a database with a character set of UTF8:CREATE DATABASE db_name DEFAULT CHARACTER SETUTF8 COLLATE utf8_general_ci;CREATE DATABASEThe syntax:CREATE{DATABASE | SCHEMA}[IF not EXISTS] db_name[create_specification [,
Create a database
CREATE DATABASE IF not EXISTS $database DEFAULT CHARSET UTF8 COLLATE utf8_general_ci; CREATE DATABASE $database DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;
Create a user and add permissions
# just create
To count the number of connections to a database, we typically count the totals without subdividing each IP. Now to monitor the number of connections per IP, the implementation is as follows:Method One:Select Substring_index (Host, ': ', 1) as IP,
These days in learning Hibernate, in the program will use hibernate to insert data into the MySQL database, found that there is a chinese garbled, searched the internet for a long time, The approximate solution is to modify the My.ini configuration
Flush Logs FaildMYSQL-ZRM Backup User permissions issue, I did not specifically try other permissions, direct grant all permissions to all tables to localhost.
MySQL binary log source path not foundThe reasons are:MYSQL-ZRM The binary log file is
1, when using index query records, be sure to pay attention to the use of the index, for example:(1) A string that is configured as a like keyword cannot start with '% '(2) When using a multicolumn index, the query criteria must use the first field
Left (outer) Join: The table is the main, which contains all the rows of the left table, and the right table satisfies the recorded data listRight (outer) join: The table that is the main, contains all the rows of the right table, and the left table
Detects if the machine has MySQL installed| grep mysqlAfter executing the above command, you see that the MYSQ socket is in the listening state, indicating that the installation was successful.Install MySQLsudo apt-get install mysql-server
First paradigm:The atomicity of the field, that is, all columns in the table are no longer divided.For example, a table has the origin of this column, but the place of origin can be divided into provinces and municipalities, so do not meet the first
View the currently supported storage engines
Mysql> show engines;+--------------------+---------+----------------------------------------------------------------+-------------- +------+------------+| engine | Support | Comment
Int (m) This m represents the width of the displayFunction: In the front-end to display an integer type of data, the database set the corresponding data type int (4), but the data written less than 4 bits, then the left padding space (if Zerofill is
Sub-table strategy1, according to the characteristics of the time table, different days, the time may be uneven, some more, some less, and may appear too large data volume situation2, according to the hash Modulus sub-table (or primary key to mold)
MySQL method to delete all tables in the database:-- switch to the database where you want to delete the table use replace_with_database_name_you_want_to_delete;-- Delete all tables Set foreign_key_ checks = 0; set group_concat_max_len=32768; set
Mysql Environment Query1. View all EnginesA) show engines or go inside the Information_schama to see the engines table .2, view current userA) Select user () can view the currentb) Show full processlist view current operations3. View Environment
This article explains the C language method of invoking the stored procedure of MySQL databaseThe following assumes that there is a SC table, save the student selection record, there is a course number, school number, peacetime points, scaled points,
In MySQL's master-slave environment, we can view some of slave's state information by executing the show slave status on Slave, which has a more important parameter seconds_behind_master. So do you understand what it really means and how it's
There are two main types of optimizations for massive data:the way of large table splitting table; optimization of SQL statements Partitioning Technology:similar to horizontal segmentation, but it is a horizontal table at the logical level, which is
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