This will conclude our “Setup a Web Server” series, with a tutorial showing you how to install the MySQL database server. It is very commonly used with PHP to create web apps, as usual installation is simple with the apt-get command, and we will also show you how to install a web-based management script, that allows you to manage your databases in a more “visual” way.
First thing to do is install MySQL itself, it runs as a standalone server, so requires very little configuration to get everything else working. Execute the following command to install the MySQL dayabase server and client tools:
sudo apt-get install mysql-server mysql-client
The simply follow the steps through the install process, at the end of that you will have a fully configured MySQL database server running, although with one main problem: No password has been set. This is usually fine on a local development machine, although it does leave the server open to potential hackers: e.g. a simple PHP script could easily clear all of your databases, so execute the following to set a password:
sudo mysqladmin -u root password {password}
sudo mysqladmin -p -u root -h localhost password {password}
Replacing {password} with the password that you want to use, and thats it. A rather secure database, now onto phpMyAdmin, a popular application for managing MySQL databases.
Install is simple, just needs the following:
sudo apt-get install phpmyadmin
Obviouslt follow the instructions, and then to see whats happened in a web browser go to http://{server.ip.address}/phpmyadmin, and in the login screen enter the username “root” and the password which you just set. From there you will be able to create new databases, edit current ones, and delete them.




No user commented in " Setup a Web Server (Part 3) - MySQL "
Follow-up comment rss or Leave a TrackbackLeave A Reply