Optimize the shell script bitsCN.com of the Mysql data table because the data volume in the company database is large, optimize the data table in the company's mysql database on a regular basis (the optimize description is as follows ), there are more than 300 data tables in the database. manual operations are obviously not realistic. the efficiency of
Test essential skills Series 1: script data import using mysql commands, essential skills mysql
Sharing
TestWhat's the problem solved in the project! Today's sharing: How to pass
MysqlHow can I import mysql script file data through the command line? ----- Solve the actual
Mysql database Flushing script contains Chinese characters and reading garbled characters. bitsCN. comMysql database Flushing script contains Chinese characters. after logging on to the database with the Mysql command, it is garbled. The possible causes are as follows:
After mysql
Calculation Method of nearby persons ----- using mysql script, ----- mysql
Calculation Method for nearby persons: drop function if exists getDistance; DELIMITER $ create definer = 'root' @ 'localhost' FUNCTION 'getdistance '(lon1 float (10, 7 ), lat1 float (6378140), lon2 float (), lat2 float () RETURNS doublebegin declare d double; declare radius int; set radius
"$ warning"-! -Z "$ critical"]
Then
Wclvls = 1
If [$ {warning}-gt $ {critical}]
Then
Wcdiff = 1
Fi
Elif [! -Z "$ warning"-a-z "$ critical"]
Then
Wcdiff = 2
Elif [-z "$ warning"-! -Z "$ critical"]
Then
Wcdiff = 3
Fi
}
# Script judgment
Val_wcdiff (){
If ["$ wcdiff" = 1]
Then
Echo "Please adjust your warning/critical thresholds. The warning must be lower than the critical level! "
Exit $ ST_UK
Elif ["$ wcdiff" = 2]
Then
Echo "Please also set a crit
Script for automatically clearing MYSQL Lock process bitsCN.com
Script for automatically clearing MYSQL Lock process the database server suddenly surges in the number of processes in a certain period of time recently, resulting in the database server to die, according to log query, the reason is that a large number of
MYSQL registration Start and Stop unmount batch processing script (Supplement), mysql Batch Processing
The batch file that was written earlier when the mysql interface was debugged.
Register and start my_install.bat
@echo offset MYSQL_DIR=%~dp0rem set MYSQL_DIR=%cd%if not "%MYSQL_HOME%"=="" ( if not "%MYSQL_HOME%"==
Below I give you the introduction of the database in MySQL to prompt MySQL server has gone away problem resolution method, if you encounter MySQL prompt MySQL server has gone away error we can enter the reference.As some small scripts rarely error, but recently imported a 10+m SQL
I have contributed a script to monitor the MYSQL process. I hope it will be helpful to you.
Function:
Monitors the MYSQL process and restarts upon failure. If the MYSQL process fails to be started, an Email notification is sent.
The Code is as follows:
#! /Bin/bash
#/Usr/bin/nmap localhost | grep3306
# Lsof-I:3306
The shell script calls the mysql stored procedure bitsCN.com
#! /Bin/sh # The function of the script is used to balance statistics, we get # data from the table accseqs, after the analysis and calculation data, # the results will be inserted into the table acc_balances. # the script is executed at 1 o 'clock by every
MySql Data backup script (not original), mysql Data Backup
Create a file xxx. bat with the following content:
@ Echo offSet hour = % time :~ 0, 2%If "% time :~ 0% % "=" "set hour = time :~ 1, 1%Set now = % Date :~ 0, 4% % Date :~ 5, 2% % Date :~ 8, 2% % hour % Time :~ 3,2% % Time :~ 6, 2%Echo % now %Set host = server addressSet port = port numberSet user =
There are two ways to import external SQL scripts to mysql: one is to use graphical tools, such as SQLYog and Navicat, and the other is to use the MySql command line interface. The following sections describe:
I. command line interface
1. start mysql:
2. log on to mysql:
3. create a database to store the impo
Every day, the mysql script is automatically backed up and scheduled to execute the script:
1. execute
Crontab-e
00 00 ***/bin/bash yourpath/mysqlbak. sh2. open the automatic execution file vi/etc/crontab and add the following content to etc to enable it to automatically execute the task. 00 00 *** root/mysqlbak. sh and above 00 *** are automatically executed ev
Run the script in mysql. you can use either of the following methods to run the script: F: \ hello world \ niuzi. SQL.
Method 1:In the command line (database not connected), enter mysql-h localhost-u root-p
Method 2:In the command line (the database is connected, and the prompt is
The MySQL batch checklist script moved the database on one server to another without knowing mysqlcheck. I want to see which table is damaged and do not want to execute it one by one on the command line, the following is my script
#! /Bin/bashPass = "123456" # root's passwordData_path = "/home/mysql" # mysql's datad
Mysql automatic batch backup script bitsCN.com
Get database name# Cat datanames. shPasswd = xxxxxxMysql -- password = $ passwd Show databases;EOFBackup Script# Cat mysql_backup.shThe retrieved system data library is stored in mysql.txt./Datanames. sh | grep-v "Database" | grep-v "ianformation_schema"> mysql.txt# Generate a database folder by date. The database c
[Window] nginx + mysql + php-cgi startup script Nginx
= Previously it was built on linux. this time it was changed to win...
Cls @ echo off # NGINX_PATH is useful in the following SET NGINX_PATH = D: SET NGINX_DIR = D:/wamp/bin/nginx/nginx-1.4.7/SET MYSQL_DIR = D: /wamp/bin/mysql/mysql5.5.24/bin/SET PHP_DIR = D:/wamp/bin/php/php5.3.13/color 0 aTITLE Nginx + PHP +
MySQL's own Mysqlbinlog | MySQL rollback is not good for you to write a simple script to try:The idea is to use Mysqlbinlog to find the transaction area that needs to be rolled back from Mysql-bin.file and then insert the DB through the script.# # INSERT needs to delete the new data corresponding to delete# # Delete ne
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.