• creating a backup

mysqldump -urommel -p -h localhost --opt darkside > darkside.sql

  • to check if MySQL is running

netstat -ln | grep mysql or sudo /etc/init.d/mysql status

  • to start/stop/retart MySQL

sudo /etc/init.d/mysql start|stop|restart|reload|force-reload|status|reset-password

1 I will have to try this again sometime. I was able to shutdown mysqld using this command but could not restart it because of a missing pipe connection. Anyway, I was too lazy to find out how to fix it that I just rebooted the machine to get mysqld running again.
  • location of the configuration file (like init.ora)

/etc/mysql/my.cnf or ~/.my.cnf

  • to start the MySQL (sqlplus equivalent in Oracle) command line tool by typing something along these lines:

/usr/bin/mysql -uroot -p

If you get the following message
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Try running
/usr/bin/mysql -uroot
If you get further Access Denied Error - checkout http://dev.mysql.com/doc/refman/5.1/en/access-denied.html for details.
  • to shutdown the service

sudo mysqladmin -p shutdown

  • to fix and recover corrupted files
    1. Shutdown the Service
    2. Locate the Datafile (listed in my.cnf)
    3. cd to the datafile location
    4. Run
    sudo myisamchk -p *.MYI