Compiling mysql from source tip

While learning about compiling programs from source using Terminal and working on a web application, I have learned a couple of things that are most useful. These revolve around mysql. There are a bunch of sites for installing and compiling mysql from source, so I won’t bother posting those instructions. However, I will post a couple of tips on items that you must ABSOLUTELY do after you compile and install mysql.

Under Terminal, go to your mysql installation directory and type in the following command:

./mysql_install_db –user=mysql

This command will setup the initial database needed by mysql to actually function.

The second command you should type in is this:

./mysqladmin -u root password newpassword

This will set the ROOT password for the database.

Once these two command have been set you should be able to connect with the GUI program of your choice. Whether it’s phpmyadmin or Mysql Administrator or MysqlBrowser.