Archive for the ‘ MySQL ’ Category

Automysqlbackup.sh.2.5 on FreeBSD

Automysqlbackup is a great tool. It’s setup and configuration can be found at many other sites. When you try to run it out of the box, you will get something like this:

./automysqlbackup.sh.2.5: Command not found.

To run it in FreeBSD, you need to edit a single line. Automysqlbackup.sh.2.5 is a bash script, and it references the path ‘/bin/sh’. In freebsd, bash is installed at ‘/usr/local/bin/bash.’ If you haven’t already, install bash:

pkg_add -r bash

Then all you have to do is edit automysqlbackup.sh.2.5. Look for

#!/bin/bash

and change it to

#!/usr/local/bin/bash

Now you should be able to launch it properly by running ‘./automysqlbackup.sh.2.5′. creating a symlink would probably work, but i like this better.

MySQL table storage engine (switching from MyIsam to InnoDB)

I know I did this the hard way. there is a command that you can issue that will convert them on the fly. what I did was mysqldump the database, reinstall mysql(because of other reasons), and then edit the dump so that the line that specified the engine reads “ENGINE=INNODB” instead of “ENGINE=MyISAM”.Then I imported the dump.

I was getting annoyed that when listing my tables in phpmyadmin,  it would show the list of tables in InnoDB (which is what i wanted), but then, when showing the summary at the bottom of the page, said “MyIsam”. I easily got rid of it by adding “default-storage-engine=InnoDB” to my “my.cnf” file.

MySQL server –purge and reinstall

Screwed around for a bit. messed up MySQL. I decided to remove –purge, and start fresh. Unfortunately, the reinstall wouldn’t work. Long story short, i had to remove “mysql-server, mysql-server-5.0, and mysql-common”. when i ran this, it also pulled out other dependencies, but i just reinstalled them all. voila! worky.

Uninstall MySQL 5 from Debian

I completely. completely messed up MySQL. Badly. I wiped out the data directory (/var/lib/mysql in Debian) and the went to remove mysql …
apt-get remove --purge mysql-server

That only deleted something like 86K. dissapointing. It looks like “mysql-server” is a shortcut pointing to the latest version of the software. The real software is found  under the name “mysql-server-50″. So what made it happen was:
apt-get remove --purge mysql-server*

That’ll wipe out whatever mysql install is in place.

FreeBSD MYSQL configuration

FreeBSD does not automatically include a default my.cnf for MySQL. Instead, a set of sample configuration files can be found under /usr/local/share/mysql. These configuration files include my-small.cnf, my-medium.cnf, my-large.cnf, my-innodb-heavy-4G, and my-huge.cnf. The appropriate file can be copied and used as a template configuration by performing the following actions:
cd /usr/local/share/mysql/
cp /usr/local/share/mysq/mysql-large.cnf /etc/my.cnf
/usr/local/etc/rc.d/mysql-server restart

thanks to http://www.barik.net/archive/2008/05/26/114616/ for the tip.

 

Switch to our mobile site