Tags: mysql scheduled backup script diary cutMost of the diary cutting and backup mechanisms are the same: The following is the Nginx diary cutting script#!/bin/bashLogPath = '/home/nginx/log 'Nglogs = '/opt/nginx/logsMkdir-p $logpath/$ (date +%y)/$ (date +%m)MV $nglogs/access.log $logpath/$ (date +%y)/$ (date +%m)/access.$ (date +%y%m%d). logMV $nglogs/error.log
Tags: mysql record databases#!/bin/bash#记录备份的时间echo "-----" $ (date + "%y-%m-%d%h:%m:%s") "-----" >>/data/backup_mysql/record.log#定义变量Myuser=rootmypassword=29749716# @HeiniaoSocket=/data/mysql/mysql.sockmycmd= "Mysql-u $MYUSER-p$mypassword-s $SOCKET"mydump= "Mysqldump-u $MYUSER-p$mypassword-s $SOCKET"Backupdir=/data/backup_mysql#正式备份For DB in ' $MYCMD-e ' show da
Label:CentOS6.7 using a non-root user (normal user) compile and install the MySQL database and implement the MySQL database service random auto-start using the Shell Script timed task mode1. About MySQL?MySQL is a relational database management system developed by the Swedis
Mysql daily backup and incremental backup script bitsCN.com
INTENDED AUDIENCE
This article is tested in linux and mysql 4.1.14. after modification, it may be applicable to mysql 4.0, 5.0 and other versions.
This article is applicable to mysql that does not enable replication
Mysql automated installation script (ubuntuandcentos64) CentOS6CentOSUbuntu
Ubuntu Mysql automated installation script
#/Bin/bash
Function hasDpkg
{
R = 'dpkg-l | grep "$1 "'
If [-n "$ r"]
Then
H = 'dpkg-l | grep "ii $1 "'
If [-n "$ h"]
Then
Return 1
Else
Return 0
Fi
Else
Return 0
Fi
}
Script sharing for exporting User permission settings in MySQL, mysql user permissions
When migrating a MySQL database, you sometimes need to migrate the users and permissions in the source database. For this migration, we can obtain the user's related permissions from the mysql
The namp scanning tool is used in the script that checks and tests the MySQL status. if nmap scanning tool is not installed in the system, install it first.
Script functions:
First, check whether the mysql Port exists normally. if the port does not exist, start the mysql
Customize a MySQL startup script based on your work environment---1. Save As/usr/local/mysql/scripts/mysql_env.ini#set MySQL init variablesMysql_user=system #mysql的用户名mysql_pass= ' Password ' #mysql的登录用户密码#check input parameter or
Tags: mysql slave zabbix masterCombine my other Zabbix to automatically discover MySQL and monitor blogs using the best:Link contact meThe script is simple and you can see it at a glance:[email protected] files]# cat libexec/slave.sh
#!/bin/bash
# #slave. SH
# #YES----1
# #NO----0
export mysql_pwd=xxxxxx
xstats () {
stats=$ (/USR/LOCAL/
: Date_format (now (), '%y%m%d ')--20150124 can refer to http://blog.csdn.net/kangbrother/article/details/7030304 in detail.12. Type conversion to use cast can refer to http://www.nowamagic.net/librarys/veda/detail/2044.13. Conditional judgment, if then ... end if; If then.. else.. End If;Len () in 14.SQLSERVER corresponds to length () in MySQL.15. Modify the data1.Update`Order', OrderordertransSET`Order`. Cyclesort=Orderordertrans. RIDwhere`Order'. '
First modify the script for necessary configuration, and then run it as the root user. 1. first, the first parameter is used for remote backup. 2. local parameter for local backup 3. parameter-free remote backup note: you need to add a user to the Mysql user on another host .. where you need to configure: # definehostandmysqlpasswordREMOTE_HOST # modify the script
MySQL database instance Parameter comparison script, mysql instance
How to compare the parameters of two MySQL instances is usually the requirement in production. Recently, a python script has been written to achieve this requirement.
S
In a UNIX system environment, you can use a variety of Unix shells combined with cron tasks to achieve automatic backup of MySQL, that under Windows How to implement it, It's very simple. Just write a custom batch script in conjunction with Taskschd.msc (Task Scheduler), you can implement, recently need to modify the tuning Windows environment of
In linux, the mysql automatic backup script code bitsCN.com is stored in/home/user/mysql_backup.sh.
Crontab
# Crontab-l
# M h dom mon dow command
28 16 ***/home/user/mysql_backup.sh
The script is as follows:
#! /Bin/sh
# Mysql_backup.sh: backup mysql databases and keep newest 5 days backup.
#
# Last updated: 20 march
Customize a MySQL shutdown script based on the working environment---1. Save As/usr/local/mysql/scripts/mysql_env.ini#set MySQL init variablesMysql_user=system #mysql的用户名mysql_pass= ' Password ' #mysql的登录用户密码#check input parameter
Tags: tar com get file Set workCustomize a MySQL shutdown script based on the working environment---1. Save As/usr/local/mysql/scripts/mysql_env.ini#set MySQL init variablesMysql_user=system #mysql的用户名mysql_pass= ' Password ' #mysql
Back up mysql database bitsCN.com using shell scripts
Back up mysql databases using shell scripts
Requirement
Sort out some script programs near the end of the year and share with you a script for mysql database backup. The environment is ubuntu10.04server.
Ideas
Obtain th
Share a script that automatically jumps to mysql slave database with the 1062 error bitsCN.com
Share a script that automatically jumps to the mysql slave database with error 1062
A sudden power loss from the database may cause the information in the log to be flushed to the hard disk. Therefore, after the slave datab
This article mainly introduces the script for exporting user permission settings in MySQL. to set the export permission for data in the user table, you can refer to the user and permission in the source database when migrating the MySQL database. For this migration, we can obtain the user's related permissions from the mysql
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.