MySQL and phpMyAdmin One-Click Application

MySQL is an open-source database management system, commonly installed as part of the popular LAMP (Linux, Apache, MySQL, PHP/Python/Perl) stack. It uses a relational database and SQL (Structured Query Language) to manage its data.

MySQL can be used to store, secure, and retrieve data for many kinds of applications, including data warehousing, e-commerce, and logging applications. It is most often associated with web-based applications and online publishing.

DigitalOcean’s MySQL and phpMyAdmin One-Click Application image quickly deploys a Ubuntu server with MySQL already installed, as well as phpMyAdmin to help manage the database server and Certbot, a tool to automate HTTPS setup and management.

Components

Droplets created using this One-Click have the following software components:

Component Version
Linux Ubuntu 18.04.1
MySQL server Latest from APT
phpMyAdmin Latest from APT
Apache Latest from APT
PHP Latest from APT
Certbot Latest from APT

In addition to the package installation, the One-Click also:

  • Enables the UFW firewall to allow only SSH (port 22, rate limited), HTTP (port 80), and HTTPS (port 443), and MySQL (3306) access.

  • Sets the MySQL root password and runs mysql_secure_installation.

  • Sets the phpMyAdmin admin password.

  • Sets up the debian-sys-maint user in MySQL so the system’s init scripts for MySQL will work without requiring the MySQL root user password.

Quickstart

After you create a phpMyAdmin One-Click Droplet:

  • You can access phpMyAdmin immediately by visiting the Droplet’s IP address in your browser.

  • You can log into the Droplet as root using either the password emailed to you or with an SSH key, if you added one during creation.

  • The MySQL root password and phpMyAdmin admin password are in /root/.digitalocean_password.

  • You can get information about the PHP installation by logging into the Droplet and running php -i.

In addition, we recommend taking steps to further secure the phpMyAdmin installation, like enabling SSL for the connection from phpMyAdmin to the database server.

API Creation

In addition to creating a Droplet from the MySQL and phpMyAdmin One-Click application via the control panel, you can also use the DigitalOcean API.

You can list all One-Click application images using the API. As an example, to create a 4GB MySQL and phpMyAdmin Droplet in the SFO2 region, you can use the following curl command. You’ll need to either save your API access token to an environment variable or substitute it into the command below.

curl -X POST -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer '$TOKEN'' -d \
    '{"name":"choose_a_name","region":"sfo2","size":"4gb","image":"mysql-18-04"}' \
    "https://api.digitalocean.com/v2/droplets"

Next Steps

Once the MySQL and phpMyAdmin Droplet is running, you can start working on projects. Here are a few examples of next steps you can take: