Category: Linux

MySQL Dump and Restore 0

MySQL Backup, Files Transfer Using scp, Restore Database

Do you ever move 2GB or 20GB files and databases from one linux host to another? I do.

If you have SSH/secure shell access to your both hosts then this is the way to do it super fast:

  • Backup your database using this command line:
    mysqldump --opt -h localhost -u dbusername -ppassword databasename > backup.sql
  • Move your public_html files using scp command:
    scp public_html.tgz
    And then uncompress it
  • Move your backup.sql to the new host:
    scp backup.sql
  • Restore your database using this command in the new host:
    mysql -h localhost -u dbusername -ppassword databasename < backup.sql
  • ... read more


    My Favourite Shell Prompt

    Do you have any favourite shell/bash prompt?

    This is mine until this article is written. You can try this by editing your .bashrc file.

    export PS1="\[\e[32;1m\]\u\[\e[0m\]\[\e[32m\]@\h\[\e[36m\] \$PWD\n\[\e[33m\]\$ \[\e[0m\]"

    This post is here because I’m tired of losing my modified shell prompt. Thanks to all linux coders around the world! 🙂

    psybnc 0

    PsyBNC Installation on Ubuntu Hardy

    I used these steps for my new vps about a month ago. These are the exact steps to install and to run a psyBNC on your Ubuntu Hardy machine. They also can be used for Debian machine.

    Okay, these are the steps:

    Download the latest version of psybnc:

    $ wget

    Extract it:

    $ tar -zxvf psyBNC-2.3.2-7.tar.gz

    After the extraction process, you’ll see a new folder called ‘psybnc’. Get into it:

    $ cd psybnc

    Now let’s move into the big step… 🙂 ... read more