Ubuntu Zero to Hero Ubuntu Zero to Hero | Page 18

Managing your databases If you're migrating an existing website or application to your new server, you may have an existing MySQL database, if you're not migrating, you might want to create a new database. Either way, the best way to do that is through PHPMyAdmin. The reason I like this tool so much is that it applies a nice user interface to a relatively complex procedure. Before you get started, you'll need to know what your MySQL root password is. This is created automatically during the installation of the LAMP stack. You can find the root password within the following file: /etc/motd.tail. In order to install PHPMyAdmin, just follow the steps below (the install process is covered in more detail in the 'advanced commands' section of this ebook): 1. sudo apt-get -y update 2. sudo apt-get -y install phpmyadmin During the installation, you'll be prompted to answer a few questions. The first of those questions asks you which web server you're using – if you've been with us since the beginning of this guide, you are running Apache2. The next question, just hit yes – this will configure PHPMyAdmin so that it's usable. The next two screens will ask you for passwords, the first is the MySQL root password that you found in the motd.tail folder (as above) and the second is the password that you would like to use to login to PHPMyAdmin. That should be it, the installation is complete. All you need to do now is make a few Apache configuration amendments. 1. Locate the file /etc/apache2/apache.conf 2. Add the line 'include /etc/phpmyadmin/apache.conf' to the bottom of the file 3. From the terminal run: 'sudo service apache2 restart' to restart the Apache server with your new configuration. You should now be able to navigate to www.yourdomain.com/phpmyadmin – why not go ahead and log in. www.netshock.co.uk