II. database Operation SQL statement1. Show what database is currently on the serverSHOW DATABASES;2. Create a database named RewinCREATE DATABASE Rewin;3. Delete the database named RewinDROP DATABASE Rewin;4. Select Rewin DatabaseUse Rewin;Third,
How to combine fields from multiple tables in MySQL and then insert them into a new table, implemented by an SQL statement. The case is: there are three tables A, B, C, now you need to check the values of several fields from table B and table C into
If an on DUPLICATE KEY UPDATE is specified at the end of the INSERT statement, and the row is inserted causing duplicate values in a unique index or primary KEY, the old row UPDATE is executed, and if the unique value column is not duplicated, the
The Products table is as follows:1. Basic character MatchingUsing regular expressions and like, the regular expression is searched throughout the column, as long as the prod_name contains the characters that are searched, and if you do not use
Connected to the MySQL database, when inserting data, the console report:Com.mysql.jdbc.MysqlDataTruncation:Data Truncation:data too long for column ' user_name ' at row 1Error, specific information is as follows:Critical: Servlet.service () for
MySQL is often encountered in the process of three failures, here a summary.1. mysql service cannot startIn the process of using MySQL, we often encounter the MySQL service can not start, the specific error message: Starting MySQL error. The server
The Server_audit module is a mariadb or skysql developed by a MySQL plugin. Can do some auditing on the above work.As is known to all, MySQL is inside is very difficult to record user's Operation command. You can use this. Supports two formats of
1. Modify the configuration fileMaster server Master:[Mysqld]Log-bin=mysql-binserver-id=222Modify the slave from the server:[Mysqld]Log-bin=mysql-binserver-id=226Restart MySQL for both servers2. Establish an account on the primary server and
§1. InnoDB row locks are implemented by locking the index entries on the index, unlike Oracle, which is implemented by locking the corresponding data rows in the data block.InnoDB This type of row lock implementation is characterized by the fact
1. Back up all databases mysqldump-uroot-p--all-database >C:\all.sql backing up all databases to the All,sql file under the C drive2. Back up a database mysqldump-uroot-p foo >C:\foo.sql backup only foo database3. Back up a table mysqldump-uroot-p
1.RAID Redundant Array of inexpensive Disks 2. Symbolic links Easy to understand is that through the connector point to the operation, artificial to distribute some databases to other folders/disk Linux: Mysql Data path:/opt/mysql/data
There are two types of solutions available online:The first is that each time a statement is executed, it is similar to PHP, and first executesOne sentence "Set names UTF8" or "Set names gb2312";1 New Mysqlcommand ("set names b2312", m_connection); 2
I like the following query condition shows:I hope the effect of the final displayMerge the group_name with the same ID into one line. Implementation method: Add the keyword group_concat in front of group_name. Then add the group by ID at the end of
MySQL default maximum connection number is 100, add the default MySQL connection number method has twoMethod One: Enter the MySQL installation directory to open the MySQL profile my.ini (Windows) or MY.CNF (Linux environment) lookup max_connections=1
Multiversion Concurrency ControlMVCC avoids many situations that require locking and reduces consumption. It depends on how it is implemented, it allows non-blocking reads, and blocks the necessary records at the time of the write operation. MVCC
1. Classification of the index B-Tree Basic Support HASH only memory support R-Tree MyISAM Support Full-textMyISAM Support (full-text indexing)2. Under the memory engine only "="Criteria will not use the
MySQL processing millions above data to improve query speed method, other database applications also have a certain reference value:1. Try to avoid using the! = or <> operator in the WHERE clause, or discard the engine for a full table scan using
How to Improve the paging efficiency of MySQL Data
The data editing and inserting tutorial in this section briefly introduces how to improve the paging efficiency of MySQL Data. The following code is a test code that improves the paging efficiency
How to configure dual-machine hot standby for MySQL database
1. There is no Incremental backup mechanism for mysql databases. Backup is a big problem when the data volume is too large. Fortunately, the mysql database provides a master-slave backup
Sorting of SQL query results
Sort in ascending order:
When the order by clause is used, data is arranged in ascending order by default. Therefore, you can use the ASC keyword to indicate the ascending ORDER or not to specify it. The default value
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