The beginner in the MySQL initialization step must be familiar with the problem that PHP cannot connect to the database just now when using MySQL. Now, let's take a look at the work to be done, on the premise that you have added the mysql working
MySql date subtraction returns the number of months 1. PERIOD_DIFF (P1, P2) returns the number of months between the period P1 and P2 (the format of P1 and P2 is YYMM or YYYYMM). Example: SELECT PERIOD_DIFF (DATE_FORMAT (g. VALIDITY, '% Y % m'),
The mysql log command has the following types of logs:-log-err query log:-log slow query log:-log-slow-queries Update log: -log-update BINARY log:-log-bin in the mysql installation directory, open my. ini, add the above parameters to the end, save
Use of MYSQL Foreign Key -- modify (ADD) Foreign Key method, Foreign Key names cannot have repeated 1. caseNumber in case_detail created in wms today cannot be associated with case_head. An error is prompted several times after the result is created,
The EXPLAIN command in MySQL shows how mysql uses indexes to process select statements and connect tables. It can help you select better indexes and write more optimized query statements. You can use the explain statement before the select statement,
Mysql simulation queue Java code -- initialization data drop table if exists t_msg_queues; create table t_msg_queues (msg_id bigint unsigned not null AUTO_INCREMENT, msg_content VARCHAR (255) not null, owner_thread_id int not null default-1, primary
Talking about the coupling between Redis and MySQL and the efficient migration from MySQL to Redis using pipelines (I) coupling between Redis and MySQL in the early stage of the business architecture, we should "look at the pot in a bowl ", don't
Potential risks arising from modifying the default character set of a mysql TABLE if you need to modify the default character set of the TABLE after creating the TABLE, you can use alter table to modify the default character set of the TABLE. alter
In MyISAM, key_buffer_size settings Key_read_requests and Key_reads are two counters. Their meanings are as follows: Key_read_requests: the number of requests that read the index from the cache. Key_reads: the number of requests that read the index
Mysql dynamically creates and deletes partition tables because of project requirements. Recently, I have studied how to dynamically create and delete partition tables in the mysql database. If all stored procedures are used, creating and deleting
MySQL running STATUS query method: run show status directly in the command line to log on to MySQL and run show status. query statements, such as show variables in the same statement. show status is used to view the running STATUS of MySQL, it is
Mysql dual-host exception and solution today, Mysql dual-host encountered two problems. Sort out the solution from the Internet and record it: run the following command to view the exception information: SQL code mysql> show slave status \ G; for
MySQL authorization (allowing slave server users to log on to the master server) 1. view the user authorization table
select user,host,password from mysql.user;
2. Set a password for the user
update mysql.user set password=PASSWORD('root') where
The Binary logs of MySQL is cleared and disabled. Recently, MySQL has been flushed. Binary Log eats more than 800 MiB of hard disk space, which interferes with the normal operation of the system. There are many solutions, including directly deleting
I have talked about using the update and replace functions in mysql to replace the specified content in batches. In fact, the method is very simple.
The syntax for batch replacement is as follows:
The Code is as follows:
Copy code
Log on to MySQL:
There must be no space before mysql-h localhost-u root-ptest password; otherwise, you must re-enter the password.
Mysql-h110.110.110.110-u root-p 123;
MySQL Command collection
1. Connect to MYSQL.
Format: mysql-h host address-u
I have introduced a lot about Database Import before. Today we want to talk about an instance which is a method for importing database files under DOS. If you need it, you can check it out.
Enter the bin directory of mysql
If you want to import SQL
Create a database in the mysql tutorial and delete a database instance
Create database ; Mysql>Mysql>Mysql> create database myDatabase;Query OK, 1 row affected (0.03 sec)
Mysql>Mysql> drop database myDatabase;Query OK, 0 rows affected (0.01
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.