DigitalOcean managed Database PhpMyAdmin configuration is easy with Bobcares by your side. Read on to learn more.
At Bobcares, we offer solutions for every query, big and small, as a part of our DigitalOcean Managed Service.
Let’s take a look at how our Support Team is ready to help customers with DigitalOcean managed Database PhpMyAdmin.
How to configure PhpMyAdmin managed Database PhpMyAdmin
PhpMyAdmin is free software that handles the administration of MySQL. In fact, we can create a phpMyAdmin One-Click droplet via DigitalOcean. Furthermore, we can access phpMyAdmin without any delay by heading to the Droplet’s IP address in our browser followed by /phpmyadmin.
Moreover, we can log in as the root into the Droplet via the password emailed to us or with an SSH key that we added during creation. The phpMyAdmin admin password and MySQL root password are in /root/.digitalocean_password.
Today, our Support Techs will demonstrate how to install and configure DigitalOcean managed Database PhpMyAdmin.
- Install configure phpMyAdmin
- Download the source files
- Configure PHPMyAdmin
- Secure phpMyAdmin Instance
How to install additional PHP modules
- First, we have to ensure that we have the additional PHP modules with the following commands:
update sudo apt install php-mbstring php-gettext
- Then, our Support Techs suggest explicitly enabling the mbstring PHP extension as seen below:
sudo phpenmod mbstring
- Next, restart Apache with the following command:
sudo systemctl restart apache2
How to download source files
Now, it is time to download the latest stable phpMyAdmin version from this link for DigitalOcean managed Database PhpMyAdmin.
- First, head to the /tmp directory and download the zip file:
$ wget https://files.phpmyadmin.net/phpMyAdmin/xxxx/phpMyAdmin-5.0.2-all-languages.zip
Replace xxxx with the phpMyAdmin version.
- Then unzip the archive and rename the folder:
$mv phpMyAdmin-xxxx-all-languages phpmyadmin
Replace xxxx with the phpMyAdmin version.
- Finally, move the phpMyAdmin folder to your document root.
How to configure PHPMyAdmin
- First, head to the PHPMyAdmin directory and then open the config.sample.inc.php file.
$ sudo nano config.sample.inc.php
- Next, update the line below to the correct database host.
$cfg['Servers'][$i]['host'] = localhost
If we are running MySQL on the same Droplet, we can use localhost.
- Finally, rename the configuration file to config.inc.php.
However, in order to log into phpMyAdmin as the root MySQL user, we have to switch to mysql_native_password from auth_socket authentication method. According to our Support Techs, we can do this via these steps:
- First, open the MySQL prompt from the terminal.
- Then, run the following command to configure the root account in order to authenticate a password:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
- After that, tell the server to reload grant tables by running FLUSH PRIVILEGES.
- Next, we will be able to visit http://domainname/phpmyadmin and login as root user.
Alternatively, we can also opt to connect to phpMyAdmin via a dedicated MySQL user for DigitalOcean managed Database PhpMyAdmin.
How to secure phpMyAdmin Instance
Our Support Team recommends configuring .htaccess authentication to protect phpMyAdmin instance. We can do this by editing the linked file in the Apache configuration directory:
sudo nano /etc/apache2/sites-available/000-default.conf
Here, we have to add an AllowOverride All directive in the <Directory /var/www/html/phpmyadmin> section of the file, as seen below:
<Directory /var/www/html/phpmyadmin> Options FollowSymLinks DirectoryIndex index.php AllowOverride All </Directory> . . .
Next, create a .htaccess file and enter the following information:
AuthType Basic AuthName "Restricted Files" AuthUserFile /etc/apache2/.htpasswd Require valid-user
After saving the file, pass it as the initial user with the .htpasswd as seen below:
$ sudo htpasswd -c /etc/apache2/.htpasswd username
After accessing the phpMyAdmin sub-directory, we must enter the additional account name and password we configured above.
Finally, phpMyAdmin is configured and ready to use on our Ubuntu server.
[Need assistance with another query? We are available 24/7.]
Conclusion
To sum up, our skilled Support Engineers at Bobcares demonstrated how to configure DigitalOcean managed Database PhpMyAdmin.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
0 Comments