Blog Archives

add script to boot

cp <script-file> /etc/init.d ln -s /etc/init.d/<scriptfile> /etc/rc.d/rc5.d/S50<scriptfile> ln -s /etc/init.d/<scriptfile> /etc/rc.d/rc5.d/K50<scriptfile> The S50 is to tell the system to start the script when it boots up, the K50 is to tell the system to shut down cleanly when you do a shut

Posted in Linux

Copy your DVD using mplayer

if you own the copy rights to your DVD of your wedding, birthday, or whatever and want to copy it to your hard drive do this: install mplayer mplayer dvd://1 -dumpstream -dumpfile /home/yourname/my_30th_birthday.vob

Posted in In My Life, Linux

Forgot root password? Reset it (MySQL)

If you need to get into MySQL but don’t have a password all you need is linux root or sudo. Here are the steps. sudo vi /etc/my.cnf   or sudo vi /etc/mysql/my.cnf add this:  skip_grant_tables under [mysqld] sudo /etc/init.d/mysqld restart mysql

Posted in Linux, MySQL, SQL

Where are all the MySQL(and postgresql) servers?

What if you are new to a network, and want to look smart? One way to do that is to know the network before someone tells you. It is also good to know if there are rouge servers out there

Posted in Linux, MySQL

Move database files from one server to another

I like to use scp to transfer files of a database from one box to another, then follow-up with an rsync. this is how I do it: sudo rsync -avz /source/path/* user@boxname:/destination/path/ Lets break it down:   -a, or –archive

Posted in Linux, MySQL, SQL

umount: /mnt/mysql_data: device is busy.

Ever got the error ‘devise is busy’ when trying to umount? I got this error once and I was CERTAIN no important scripts were running on it. This is how I umounted: sudo umount -l /mnt/mysql_data/ The -l is ‘lazy’

Posted in Linux

nodiratime AND noatime?

I once saw a recommendation to mount using nodiratime AND noatime like this: mount -t xfs /dev/md0 /mysql_data -o nobarrier,noatime,nodiratime But then I looked into it further and found this:   that suggested that noatime includes nodiratime ” void touch_atime(struct vfsmount

Posted in Linux, MySQL

ERD with Dia

I recently found a very cool trick using Dia to make an ERD. sudo yum install dia Get this: Then run a script like this: mysql -uyouruser -pyourpass -A -Dyourdatabase -e ‘SELECT CONCAT(“desc “,table_name,”;”) AS cmd FROM (select table_name

Posted in Linux, MySQL, SQL

Extra Installs

Here are some things I like to install on a new box: zint throttle fuse-sshfs htop dia And for testing client applications:

Posted in Linux

Unknown table engine ‘InnoDB’

Recently I restarted MySQL. All of my InnoDB tables had error: Unknown table engine ‘InnoDB’ This is how I fixed it: Ran:  SHOW ENGINES;   and InnoDB was not listed Checked my.cnf …. it did not have skip-innodb cd to

Tagged with:
Posted in Linux, MySQL, SQL