Mysql backup script and delete the backup file bitsCN.com from the previous five days
USER = root # Database username
PASSWORD = cucrzmysql # database user PASSWORD
# DATABASE = idssr # DATABASE name
For DATABASE in 'ls/mysql/data/mysql/| grep idss' # DATABASE name
Do
# WEBMASTER = 849699940@qq.com # administrator emai
MYSQL binary log management script bitsCN.com
MYSQL binary log management script is used to flush the database every hour to generate new binary logs, back up binary logs to NFS, and compress and store them :#! /Bin/bash # Purpose: manages mysql binary logs, refreshes binary
The MySQL + PHP mode often causes a large number of zombie processes in MySQL under high concurrency pressure, resulting in service downtime. In order to automatically kill these processes, a script is created and automatically executed on the backend of the server using crontab. After this is found, it is indeed a good relief of this problem. Send this
UbuntuServer MySql database backup script code: UbuntuServerUbuntu
BitsCN.com
Note:
Here I want to back up the pw85 database under the/var/lib/MySql database directory to the compressed file format of/home/snapshot (2012_04_11 refers to the date on which the backup was executed ), at last, only the backups of the last 7 days are retained.Steps:1. create a direct
20140509-MySQL: How to import a script file and display garbled characters when inserting data
20140509-MySQL: How to import a script file and display garbled characters when inserting data
Open CMD and enter the following command:
Mysql-u root-p
Then enter the password:
Mysql Performance Optimization script mysqltuner. pl usage introduction bitsCN.com
MySQLTuner: http://github.com/rackerhacker/MySQLTuner-perl
MySQLTuner usage:Downloading and using MySQLTuner is actually a very simple process:
Wget mysqltuner. plPerl mysqltuner. pl
If you 'd rather not invoke perl every time, just make it executable:
Chmod u + x mysqltuner. pl./Mysqltuner. pl
» Latest development versionIf
This article mainly introduces the mysql stress test script. The example shows the complete method for implementing the MySQL stress test. if you need it, refer to the example below to describe the mysql stress test script, share it with you for your reference. The details a
Label:Source: Http://zhidao.baidu.com/link?url=p78PlTJZlheB4uSKCkmZApg-3qrTIBCS3yI5LbGJLEAnUuO3-4GE6dLqq1LWC_kneZMWxR6q_ Xw8ts4g7sf6e2wrowl3b2amk5kblpygsmsBoth Linux and Windows are commonThe first method:At the command line (not connected to the database), enter mysql-h localhost-u root-p123456 The second method:At the command line (the database is connected, the prompt is mysql>), enter the source F:\hell
operation, the following are MySQL5.0 under the test by first note, remember at the end of each command plus; (semicolon)
1. Export the entire database
Mysqldump-u user name-p--default-character-set=latin1 Database name > exported file name (database default encoding is latin1)
Mysqldump-u wcnc-p SMGP_APPS_WCNC > Wcnc.sql
2. Export a table
Mysqldump-u user name-P database name Table name > exported file name
Mysqldump-u wcnc-p SMGP_APPS_WCNC users> wcnc_users.sql
3. Export a database structure
mysql| Script | Automatic installation After a few days of testing, finally can be released!
1. Under the MySQL source code directory to create a new script install.sh, add the following code to this script:
#!/bin/bash######################################################
Tags: mysql flush back1. IntroductionIn the Oracle database, when a false operation is committed, we can flash the table back to the state before the error operation via the Flash back function provided by Oracle. There is no native flush back feature in MySQL, and when the DBA is operating in error, the traditional recovery method is to use the full-standby + binary log roll forward to recover.Today to int
LNMP (nginx + mysql + php) Environment/architecture one-click installation script
LNMP (nginx + mysql + php) Environment/architecture one-click installation script, which has passed the test on CentOS 7.1, with a time of 27 minutes and hardware environment (1G, 1U ). This script
MySQL 5.5.40 automated installation script
After learning the Linux Shell script for two weeks, I finally wrote a MySQL automated installation script. With the full-day test today, MySQL 5.5.40 can be installed normally. Other ver
Tags: 3.1 ida reference insecure ROC 2.3 Monit the HandmadeFirst, login password encryption authentication script application ScenarioDaily operation, the MySQL password is often specified in plaintext to log in to the MySQL service, the following warning will be thrown after successful login:[Email protected] ~]# mysql
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. If replication is started, you may not need to adopt this backup policy or modify relevant parameters.
Each person may have different backup policie
Use the mysqldump command to back up the MySQL database script (without a comment version, suitable for production environments)
Use the mysqldump command to back up the MySQL database script (without a comment version, suitable for production environments)
Design and write considerations for this
If you host your own blog or any Web-based application running on the stack, you shoshould have a backup system in place for keeping data stored in MySQL databases safe. there are several solutions that can help you with that, but nothing beats a simple Bash script I stumbled upon in a blog post comment. here is the script in all its beauty:
[If you manage your o
: ‘{print $NF}‘ ;DoMysql-uroot-p$i-e "SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' a123456 ');"-B--connect-expired-password#设置远程主机登录, note: If the production environment does not mind to open the root remote login (security issues)Mysql-uroot-p ' a123456 '-e "GRANT all privileges on . To ' root ' @ '% ' identified by ' a123456 ' with GRANT OPTION;Mysql-uroot-p ' a123456 '-e "FLUSH privileges;"don
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.