mmerian / mysql-maint Goto Github PK
View Code? Open in Web Editor NEWA bash script that performs backups and maintenance on your MySQL servers
License: GNU General Public License v3.0
A bash script that performs backups and maintenance on your MySQL servers
License: GNU General Public License v3.0
Hi there, I just updated from version 1.0 of your script. The new version did not run (giving error unable to connect to DB server), whereas the previous version had no problems (I had updated the authentication info appropriately).
I eventually fixed this by removing the apostrophes from around the hostname on this line:
IDENT_OPTS="${IDENT_OPTS} -h '${DB_HOST}' "
It seems strange that nobody else has reported this, maybe it's just my server! I'm on CentOS 6.0. It's worth noting that the previous version of the script which did work did not have apostrophes around the hostname.
Regards, Ben
This issue has been opened on the old Google Code hosting platform, so I reopen it here :
It seems there's a bug in line 335 :
while getopts "bmhvlHS:u:p:P:d:n:c" option
Should be :
while getopts "bmhvlH:S:u:p:P:d:n:c" option
(The Host option argument does not work)
Hi there, I'm having a problem with this script on a server. The script is creating database backup folders, and using database names, that are truncated. For example, where the database name is preprofi_mysql, the script is creating a folder called preprofi_, and calling mysqldump with the same (incorrect) name. Thus, the backup is failing.
Some databases are backed up, and some are not - there doesn't seem to be any reason why one db is backed up and another not, it's definitely not because there is a '' in the name, some databases which have '' in the name are backed up OK. It's not because the name suffix is '_mysql' - some dbs are not backed up which don't have this suffix.
I checked the output of ${MYSQL} -e "SHOW DATABASES"
- this is definitely outputting the correct db names.
Needless to say, this is driving me crazy! Can you offer any ideas on the problem?
AHA, Ben
I'm getting the following error after the script finishes checking all my tables:
stat: invalid option -- s
Try `stat --help' for more information.
./mysql_maint.sh: line 838: [: -gt: unary operator expected
Should line 824 be:
eval "`${STAT_BIN} -c%s "$1"`"
?
I would like to see an option to lock database tables while taking the backup. Is there a reason this is not implemented? See --lock-tables and --lock-all-tables for mysqldump. I just want to know if there is a reason not to do this. Typically you wouldn't want to be backing up a database while some process is doing some work on the database. You risk inconsistent data.
Great script though. Thank you writing it. It is very convenient.
-Reuben
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.