MySQL Replication howto for Snow Leopard…

Apple, Macintosh, mysql, osx Server, Sysadmin, Tip
We recently upgraded our servers from old XServe G5's running Tiger to the latest greatest running Snow Leopard. In this small howto I will deal with the procedure I followed to setup mysql master-slave replication between two new servers. I start out with two (master, slave) empty DB's, setup the replication and then import my data from a third server (my old G5 X-Serve). Of course like anything else I will try to show you how to get out of -- what I like to call -- Steve Jobs Hell Holes :-). There are other ways of doing this procedure, for more info check out this page. - First things first....the magic command that stops mysql server from command line, just in case you screw something up and need to…
Read More

MySQL: Transfering users and priviledges to a new server….

CLI, mysql, Sysadmin, Tip
So this was a great big mystery this morning. How the heck do you transfer the users and their privileges out of a old mysql server and "import" them into a new server. We recently upgraded from OSX 10.4.11 to a couple of spanking new Snow Leopard servers and during the mysql export/import cycle this issue came up. Well the simple answer is.....DON'T USE mysqldump on your mysql DB (you know the default DB that stores all your users and privileges. It's a bad idea and will probably do more harm than good. Instead use the following procedure: 1) On your old server (the one that has your data/users/tables on it) issue the following command (replace YOUR dbadmin/root username and  password in the 2 appropriate places: mysql -B -N --user=admin…
Read More

Step-by-step instructions to get Cacti installed on Ubuntu 9.04 (Jaunty Jackalope) Desktop Edition

Apache, cacti, Linux, mysql, Opensource, php, Ubuntu, Unix
So after yesterdays rant, I went back and figured out how to install the Cacti monitoring software (OSS, Free) onto a Ubuntu 9.04 "Jaunty Jackalope" Desktop installation. This guide uses packages only, no compiling, no Makefiles or anything like that.....You should be able to just follow this and get a fully functioning Cacti installation in about 30 minutes. Here are the steps:install ubuntu 9.04 ("Jaunty Jackalope") Desktop Edition on your machine Login, open a Shell window and install ubuntu LAMP (Linux/Apache/MySQL/PHP) server stack on your machine "sudo tasksel install lamp-server". Note: Make sure you remember the password for "root" user in mysql Database, write it down somewhere, we will need it later on.Get a superuser shell started since it will make for less typing. "sudo -i" followed by your password.…
Read More

SSH Tunneling to mysql server using Putty

mysql, ssh, Tricks, Tutorial
 I've had this question a couple of times in the past few months (since I posted the command line version of this method here ). To make it short and sweet, yes you can use Putty in a windows environment to setup ssh tunnels. Here is the specific scenario with pics for setting up a tunnel to your mysql server (assuming mysql server is running on a machine that you have ssh access to) using putty. This allows you to run mysql-gui-tools under windows and connect thru ssh to your server, without having to open the server to accept connections from the network.Download Putty full install package Run putty and your'll see the following screen. Fill in the hostname of the DB server and choose SSH as protocol.Go down to SSH and Tunnels options.…
Read More

Tunnel to locally running mysql server using ssh

Linux, mysql, ssh, Unix
Running and administrating mysql can sometimes be a hassle especially if you're running a semi-secure environment. This usually means that your mysql server will not accept connections from outside and only localhost connections are allowed. There is a quick way of getting around this if you're stuck somewhere and really need to use that graphical admin/browser tool to get to your DB server. All you really need to do is forward port 3306 on your local machine to port 3306 on the DB server through a ssh tunnel. Here is the ssh command you need to issue to start things up:ssh -L 3306:127.0.0.1:3306 yoursshloginid@yourserver.yourdomain.comOnce you supply the password for the ssh session you're in business, the encrypted tunnel is up and running. All you need now is to point Mysql…
Read More