Detecting MySQL Sync State Implementation code (PHP/LINUX)

The code is as follows Copy Code #!/bin/sh#check Mysql_slave Status#crontab Time 00:10Mysql_user= "Root"Mysql_pwd= "123456"Mysql_slave_log= "/tmp/check_mysql_slave.log"Email= "1351010****@139.com"Mysql_port= ' Netstat-na|grep

How to lock a MySQL datasheet

When you perform a datasheet check or patch, you can lock the datasheet to ensure that the data table is secure: Mysql>lock TABLE tbl_name READ; Mysql>flush TABLES; The task of checking or patching a data table before it is locked. Complete and then

Two ways to connect MySQL via PHP

MySQL can be connected to the Web through PHP in two ways, a MySQL-related function via PHP, and another ODBC-related function via PHP The related functions are as follows: MySQL function Mysql_affected_rows: Gets the number of columns affected

Take random data out of MySQL implementation table

Previously discussed this issue in the group, the comparison is interesting. MySQL's syntax is really fun. They all want to use PHP to implement the random, but take out more than two times as if to do more than a query. Turn the manual, find the

A program implementation method for importing large amounts of data from MySQL

We must have used phpMyAdmin inside the database import, export function, very convenient. But in practical applications, I found the following questions: 1, the database exceeds a certain size, such as 6M at this time using the export generally no

How to assign permissions to MySQL under Win system

Create a userCreate a user named Mysqlusr, set a random password, the length of the password is the bestDo not have less than 20 digits. 2. Set the user's identityAdd MYSQLUSR users to the Guests group and remove any other groups. 3. Set disk

MySQL fuzzy search like implementation tutorial

Under MySQL, in the Chinese fuzzy search, often return some unrelatedRecords, such as looking for "%a%", may return a Chinese character, but no a characters exist.I have encountered similar problems before, after a detailed reading of MySQL Manual,

MySQL Modify GROUP by instance

GROUP by Modify Program。 Imagine a table named sales with a profit column for the year, country, product, and record sales profit: CREATE TABLE www.111cn.net ( Year INT is not NULL, Country VARCHAR is not NULL, Product VARCHAR not NULL,

Shell Bulk Delete in Linux specify tables in MySQL

Today, I built a test environment on my test server, but there is a problem with the connection between the Web and MySQL, I am a bit lazy, do not want to MySQL in this test library to remove the recreate and give permissions, just want to take the

MySQL uses slow log to show a large number of Binlog dump records

There is a database on the line, and in slow log there are a number of records similar to the following: The code is as follows Copy Code # time:130823 13:56:08# User@host:repl[repl] @ slave [10.x.x.x]# query_time:9.00083

Linux MySQL database backup and recovery

1. Backup The code is as follows Copy Code [Root@localhost ~]# cd/var/lib/mysql (access to MySQL library directory, adjust directory according to your MySQL installation situation)[Root@localhost mysql]# mysqldump-u root-

Automatic backup of MySQL two-segment scripts in Linxu every day

Timed execution Script: Perform The code is as follows Copy Code CRONTAB-E * * */bin/bash yourpath/mysqlbak.sh Open an automatic execution file The code is as follows Copy Code

FreeBSD mysql password forgot to find the way

Remember, the original and Linux under the solution is not the same. The code is as follows Copy Code # Killall-term MYSQLD//Kill all MySQL processes first#/usr/local/bin/mysqld_safe--skip-grant-tables & will

Turn off MySQL's DNS reverse resolution (unauthenticated user solution)

Cases The code is as follows Copy Code Mysql>show processlist;| 20681949 | Unauthenticated user | a.b.c.d:52497 | NULL | Connect | | Reading from net | NULL || 20681948 | Unauthenticated user | w.x.y.z:52495 | NULL |

MySQL large amount of data import and Export command detailed

In the face of large data volumes, large file SQL operations, we need to rely on MySQL powerful command operations: 1. Database Import command The code is as follows Copy Code Mysql-h Localhost-u Root-pUse dbnameSOURCE

MySQL View user permissions in two ways

Ysql two ways to view user permission commands: A. Use MySQL grants How to use: The code is as follows Copy Code Mysql> show grants for Username@localhost; instance:Mysql> show grants for root@localhost;+----------------

A detailed explanation of SELECT INTO statement usage in MySQL

Syntax Introduction: Insert all columns into a new table The code is as follows Copy Code SELECT * into new_table_name [in externaldatabase] from Old_tablename Just insert the desired column into the new

MySQL Limit optimization method

MySQL Limit optimization method SELECT * FROM table LIMIT [offset,] rows | Rows Offset Offset The LIMIT clause can be used to force a SELECT statement to return the specified number of records. LIMIT accepts one or two numeric parameters.

Golang MySQL Query returns an indeterminate field

Golang MySQL Query returns an indeterminate field implemented as follows:First, the slice of the query field is obtained by func (Rs *rows) Columns ([]string, error), then the slice is constructed, the value of each scan is put in, and finally the

Discuz hot posts paging database mysql optimization

In our environment, the MySQL-5.6.6 version is used.When viewing a post and turning pages, an SQL statement similar to the following will be generated:Mysql> desc SELECT * FROM pre_forum_post WHERETid = 8201301 AND 'invisable' IN ('0', '-2') order

Total Pages: 3233 1 .... 1842 1843 1844 1845 1846 .... 3233 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.