Archive for category MySQL Server Support

LCOD – 4.12.10 – Quick Mysqlreport to e-mail setup

This will be a quick install to setup your server to e-mail you daily mysql reports using the cool mysqlreport application at hackmysql.com

Click to continue reading “LCOD – 4.12.10 – Quick Mysqlreport to e-mail setup”

, , , , , , , ,

No Comments

LCOD – 5.9.07 – Find out what Perl DBI drivers are installed


Warning: htmlspecialchars_decode() expects parameter 1 to be string, NULL given in /home/content/m/d/x/mdxdoug/html/jonzobrist/wp-includes/compat.php on line 113

A perl one liner for you.

Say you’re installing something that is DBI and it’s giving errors or having problems,

or anything, and you want to know if it’s because you don’t have the correct perl DBI

driver installed? This is a simple, one liner, which will tell you a list of all the perl DBI drivers.

Run from the command line

perl -e ‘use DBI;@driver_names = DBI->available_drivers; print “@driver_names\n”;’

You should get output like

DBM ExampleP File Proxy SQLite2 Sponge mysql

enjoy

, , ,

No Comments

MySQL backup sript – more info

Here’s my script to backup mysqlTo install it on a linux/freebsd box just edit the top parts for configuration. If you make a user mysqldump with home directory of /home/mysqldump and a mysql password of p@assword, make a /home/mysqldump/logs and /home/mysqldump/bkup directories, this should just work. Hack it up, it’s GPL’d.

Please email me updates you make and I will post them here. My email is kgb@bluesun.netThis e-mail address is being protected from spam bots, you need JavaScript enabled to view it

More “in depth” installation:

adduser mysqldump
passwd mysqldump
mysql -p
GRANT select,lock tables on *.* to mysqldump@localhost identified by ‘p@ssword’;
flush privileges;
su – mysqldump
mkdir ~/bin
mkdir ~/logs
mkdir ~/bkup
cd ~/bin
wget http://www.submarinefund.com/backup_mysql/backup_mysql
chmod u+x backup_mysql
vi backup_mysql
make changes to config
– change passwd to the same one you used on the
GRANT instead of p@ssword
– change num_days_keep to the number of days you want to keep around

– change all the commands to match your system, these
should be the same on most linux systems, BSD’s may
need to change some paths

test the script

add a line to your crontab like this
0 3 * * * /home/mysqldump/bin/backup_mysql >> /home/mysqldump/logs/cron.log 2>&1

script gzipped

script txt

script zip zipped

, ,

No Comments

MySQL backup script

I wrote this script because I needed to have each table in all databases backed up separately.
If you have hundreds or thousands of tables and and want to back them up separately then this script could help. It also names and rolls files by unix timestamp, and allows you to specify
how long a file is kept, regardless of number of backups made. So, say you want 2 days of backups, and you make one every hour (48 total) it will auto roll them after 2 days, suppose then you manually run the script to create a backup before some important change or event, this will still keep that backup for 2 days.

Here‘s my script to backup mysql

To install it on a linux/freebsd box just edit the top parts for configuration. If you make a user mysqldump with home directory of /home/mysqldump and a mysql password of p@assword, make a /home/mysqldump/logs and /home/mysqldump/bkup directories, this should just work. Hack it up, it’s GPL’d.

Please email me updates you make and I will post them here. If you have questions you can email me, or post them on my LCoD message board. My email is kgb@bluesun.netThis e-mail address is being protected from spam bots, you need JavaScript enabled to view it , but I don’t really check it that much ;)

More “in depth” installation:
adduser mysqldump
passwd mysqldump
mysql -p
GRANT select,lock tables on *.* to mysqldump@localhost identified by ‘p@ssword’;
flush privileges;
su – mysqldump
mkdir ~/bin
mkdir ~/logs
mkdir ~/bkup
cd ~/bin
wget http://www.submarinefund.com/backup_mysql/backup_mysql
chmod u+x backup_mysql
vi backup_mysql
make changes to config
- change passwd to the same one you used on the
GRANT instead of p@ssword
- change num_days_keep to the number of days you want to keep around

- change all the commands to match your system, these
should be the same on most linux systems, BSD’s may
need to change some paths

test the script

add a line to your crontab like this
0 3 * * * /home/mysqldump/bin/backup_mysql >> /home/mysqldump/logs/cron.log 2>&1

, , ,

No Comments