Backing up your database is a very important system administration task, and should generally be run from a cron job at scheduled intervals. We will use the mysqldump utility included with mysql to dump the contents of the database to a text file that can be easily re-imported.
For every database, you should set the root or sa passwords to something other than the default, unless you want to get hacked. For mysql, the system administrator user is called root. You will use the mysqladmin utility from a command line to set the new password. Notice that there are two commands to be run.
By default, MySQL only allows connections from the localhost address. The configuration file is usually found in /etc/mysql/my.cnf
Simply open a new Terminal window and type in this command
Simply run this command:
Instead of having to constantly type in ‘sudo’ every time you need to make an admin change, you can use one of these commands to act as root.
The Ruby language has a very simple control structure that is easy to read and follow.