The date_format and STR_TO_DATE of MYSQL are recently used in the project. Have a good time with the MYSQL date conversion function. The process is as follows:
Take the current year: SELECT DATE_FORMAT (CURDATE (), '% Y year'); output: SELECT
Mysql database learning-3. Table creation, deletion, and change
Create table mytbl (id int auto_increment not null, name char (10) not null, birth date not null, wight int, sex enum ('F ', 'M'); create table mytbl (id int auto_increment not null,
Analysis of MySQL 7 types of logs (I) Error Log ① parameter log_error: Specify the log location and name ② function (I) Error/alarm information (ii) optimization help (ii) Slow query log ① parameter log_slow_queries: specify the log location and
When MySQL uses the select distinct name from table Statement of MYSQL to deduplicate a specified field, only the information of the name field after deduplication is output, the hope is to output the information about the examinee's ID, examination
MySQL learning footprint record 07 -- Data Filtering -- use regular expressions to retrieve the search data used in this article
mysql> SELECT prod_name FROM products -> ORDER BY prod_name;+----------------+| prod_name |+--------
For MySQL DML operations, we recommend that you (I) INSERT large data volumes (I) replace a single row with multiple rows:
insert into t values (),(),(),...
(2)
LOAD DATA INFILE ... INTO TABLE t
(3) Write a temporary table and INSERT... SELECT (4)
MySQL query solution: Mysql calculates the values of multiple fields. The original database is as follows. All fields are of the int type.
+----+---------+---------+| id | column1 | column2 |+----+---------+---------+| 1 | 1 | 2 || 2 |
Among the many functions in the MYSQL database, there are two functions used for connection: MysQL-connect () and MySQL _ pconnect (). Syntax: int MySQL-connect (string [hostname] (: [Port, string [username], string [password]) int MySQL _ pconnect (
Mysql /*! */Is often seen in MySQL SQL statements or SQL files as follows:
SELECT /*!40001 SQL_CACHE */ * FROM pre_common_syscache WHERE cname IN ('ipbanned')/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;/*!40101 SET
MySQL optimizes the Limit page. Many times, we need to select the specified number of lines starting from the specified position. At this time, limit laughed at the definition of limit: limit x, y indicates selecting y records starting from Line x.
The following example shows how to use the MySQL client to install a new user. These examples assume that the permission has been installed by default. This means that, in order to change, you must be on the same machine that MySQL is running, you
[SQL] MySQL uses mysqlbinlog for Incremental backup and recovery detailed explanation of the Incremental backup process (1) Configure My. cnf file (my. INI file), enable binary backup: [SQL] log-bin = D:/Program Files (x86)/MySQL/mylog/juelog here
The following describes how to solve the Mysql data rollback error. You can refer to the following two methods for MYSQL transaction processing. 1. Use begin, rollback, and commit to start a transaction rollback transaction to roll back the commit
The mysql group by statement can be used to deduplicate a column. Directly run the following statement:
Select io_dev_id from io_info where (TID = 1 AND host_name = 'ang1') group by 1;
Deduplicate query by io_dev_id. P: The difference between
Mysql-merge table [SQL] Note: 1 the structure of each sub-table must be consistent, and the structure of the master table and sub-table must be consistent, 2. The index of each sub-table exists in the merge table. Therefore, you cannot perform a
Mysql master-slave replication and cascade record the master-slave replication and cascade replication of mysql. I. Environment HOST: 192.25.10.71 HOST: 192.25.10.73 slave: 192.25.10.76DB: Mysql 5.5.31OS: CentOS 6.3 II. Architecture 3.
Mysql 1130 error solution 1. error 1130-Host 'ipaddr 'is not allowed to connect to this MySQL server 2. The cause of the problem is that no authorization is granted, therefore, access is denied.
SQL code # mysql-uroot-p Enter password: Welcome to
Check and fix mysql database tables01 #! /Bin/sh02 # code by scpman03 # function: Check and fix mysql database table 04 # Add the script to the schedule. When the script is executed, it will read the database, list all the tables to be repaired, and
Shell preliminary: mysql regularly resends local data every day and replaces remote database data 01mysql regularly resends local data every day, to replace the remote database data 02, You need to import the tb_a table in the ser_a database on 192.1
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