How To Install and Secure phpMyAdmin on Ubuntu 18.04 (document has error)

Hi, I’m getting an error

Last login: Mon Apr 13 12:36:35 on ttys000
Mars-MBP:~ Mars$ ssh root@
The authenticity of host ' (' can't be established.
ECDSA key fingerprint is SHA256:sJ+W3twV/KKyoLTfThMlBs2yXY+gYtPw3z43ysuLb1U.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (ECDSA) to the list of known hosts.
root@'s password: 
You are required to change your password immediately (root enforced)
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-91-generic x86_64)

 * Documentation:
 * Management:
 * Support:

  System information as of Mon Apr 13 09:53:04 UTC 2020

  System load:  0.05              Processes:           93
  Usage of /:   4.2% of 48.29GB   Users logged in:     0
  Memory usage: 27%               IP address for eth0:
  Swap usage:   0%

66 packages can be updated.
29 updates are security updates.


Welcome to DigitalOcean's One-Click WordPress Droplet.
To keep this Droplet secure, the UFW firewall is enabled. 
All ports are BLOCKED except 22 (SSH), 80 (HTTP), and 443 (HTTPS).

In a web browser, you can view:
 * The WordPress One-Click Quickstart guide:
 * The new WordPress site:

On the server:
 * The default web root is located at /var/www/html
 * The MySQL root password and MySQL wordpress user password are saved
   in /root/.digitalocean_password
 * The must-use WordPress security plugin, fail2ban, is located at
 * Certbot is preinstalled. Run it to configure HTTPS. See for more detail.
 * For security, xmlrpc calls are blocked by default.  This block can be
    disabled by running "a2disconf block-xmlrpc" in the terminal.

   After connecting to the Droplet for the first time,
   immediately add the WordPress administrator at

For help and more information, visit

To delete this message of the day: rm -rf /etc/update-motd.d/99-one-click

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

Changing password for root.
(current) UNIX password: 
Enter new UNIX password: 
Retype new UNIX password: 
This script will copy the WordPress instalation into
Your web root and move the existing one to /var/www/html.old
This setup requires a domain name.  If you do not have one yet, you may
cancel this setup, press Ctrl+C.  This script will run again on your next login
Enter the domain name for your new WordPress site.
(ex. or do not include www or http/s
Domain/Subdomain name:
Enabling conf block-xmlrpc.
To activate the new configuration, you need to run:
  systemctl reload apache2
Now we will create your new admin user account for WordPress.
Your Email Address:

Username: london


Blog Title: erse

Is the information correct? [Y/n] Y

Next, you have the option of configuring LetsEncrypt to secure your new site.  Before doing this, be sure that you have pointed your domain or subdomain to this server's IP address.  You can also run LetsEncrypt certbot later with the command 'certbot --apache'

Would you like to use LetsEncrypt (certbot) to configure SSL(https) for your new site? (y/n): n
Skipping LetsEncrypt certificate generation
/opt/digitalocean/ line 94: break: only meaningful in a `for', `while', or `until' loop
Finalizing installation...
--2020-04-13 09:54:23--
Resolving (
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5568133 (5.3M) [application/octet-stream]
Saving to: ‘/usr/bin/wp’

/usr/bin/wp         100%[===================>]   5.31M  --.-KB/s    in 0.1s    

2020-04-13 09:54:23 (49.2 MB/s) - ‘/usr/bin/wp’ saved [5568133/5568133]

Completing the configuration of WordPress.Success: WordPress installed successfully.
Installing WP fail2ban (
Downloading installation package from
Unpacking the package...
Installing the plugin...
Plugin installed successfully.
Success: Installed 1 of 1 plugins.
Plugin 'wp-fail2ban' activated.
Success: Activated 1 of 1 plugins.
Installation complete. Access your new WordPress site in a browser to continue.
root@erhan:~# sudo apt update
Hit:1 main InRelease
Get:2 bionic InRelease [242 kB]         
Hit:3 bionic-updates InRelease          
Hit:4 bionic-backports InRelease        
Hit:5 bionic InRelease                        
Hit:6 bionic InRelease         
Get:7 bionic-security InRelease [88.7 kB]    
Hit:8 bionic InRelease              
Fetched 331 kB in 1s (424 kB/s)                                                
Reading package lists... Done
Building dependency tree       
Reading state information... Done
62 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@erhan:~# sudo apt install phpmyadmin php-mbstring php-gettext
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  dbconfig-common dbconfig-mysql javascript-common libjs-jquery
  libjs-sphinxdoc libjs-underscore php-pear php-php-gettext php-phpseclib
Suggested packages:
  php-libsodium php-mcrypt php-imagick www-browser
The following NEW packages will be installed:
  dbconfig-common dbconfig-mysql javascript-common libjs-jquery
  libjs-sphinxdoc libjs-underscore php-gettext php-mbstring php-pear
  php-php-gettext php-phpseclib php-tcpdf phpmyadmin
0 upgraded, 13 newly installed, 0 to remove and 62 not upgraded.
Need to get 13.0 MB of archives.
After this operation, 51.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 bionic/main amd64 dbconfig-common all 2.0.9 [601 kB]
Get:2 bionic/universe amd64 dbconfig-mysql all 2.0.9 [1038 B]
Get:3 bionic/main amd64 javascript-common all 11 [6066 B]
Get:4 bionic/main amd64 libjs-jquery all 3.2.1-1 [152 kB]
Get:5 bionic/main amd64 libjs-underscore all 1.8.3~dfsg-1 [59.9 kB]
Get:6 bionic/main amd64 libjs-sphinxdoc all 1.6.7-1ubuntu1 [85.6 kB]
Get:7 bionic/universe amd64 php-php-gettext all 1.0.12-0.1 [16.2 kB]
Get:8 bionic/universe amd64 php-gettext all 1.0.12-0.1 [1508 B]
Get:9 bionic/universe amd64 php-phpseclib all 2.0.9-1 [176 kB]
Get:10 bionic/universe amd64 php-tcpdf all 6.2.13+dfsg-1ubuntu1 [7791 kB]
Get:11 bionic/universe amd64 phpmyadmin all 4:4.6.6-5 [3861 kB]
Get:12 bionic/main amd64 php-pear all [286 kB]
Get:13 bionic/main amd64 php-mbstring all [6344 B]
Fetched 13.0 MB in 1s (10.6 MB/s)  
Preconfiguring packages ...
Selecting previously unselected package dbconfig-common.
(Reading database ... 95102 files and directories currently installed.)
Preparing to unpack .../00-dbconfig-common_2.0.9_all.deb ...
Unpacking dbconfig-common (2.0.9) ...
Selecting previously unselected package dbconfig-mysql.
Preparing to unpack .../01-dbconfig-mysql_2.0.9_all.deb ...
Unpacking dbconfig-mysql (2.0.9) ...
Selecting previously unselected package javascript-common.
Preparing to unpack .../02-javascript-common_11_all.deb ...
Unpacking javascript-common (11) ...
Selecting previously unselected package libjs-jquery.
Preparing to unpack .../03-libjs-jquery_3.2.1-1_all.deb ...
Unpacking libjs-jquery (3.2.1-1) ...
Selecting previously unselected package libjs-underscore.
Preparing to unpack .../04-libjs-underscore_1.8.3~dfsg-1_all.deb ...
Unpacking libjs-underscore (1.8.3~dfsg-1) ...
Selecting previously unselected package libjs-sphinxdoc.
Preparing to unpack .../05-libjs-sphinxdoc_1.6.7-1ubuntu1_all.deb ...
Unpacking libjs-sphinxdoc (1.6.7-1ubuntu1) ...
Selecting previously unselected package php-pear.
Preparing to unpack .../ ...
Unpacking php-pear ( ...
Selecting previously unselected package php-mbstring.
Preparing to unpack .../ ...
Unpacking php-mbstring ( ...
Selecting previously unselected package php-php-gettext.
Preparing to unpack .../08-php-php-gettext_1.0.12-0.1_all.deb ...
Unpacking php-php-gettext (1.0.12-0.1) ...
Selecting previously unselected package php-gettext.
Preparing to unpack .../09-php-gettext_1.0.12-0.1_all.deb ...
Unpacking php-gettext (1.0.12-0.1) ...
Selecting previously unselected package php-phpseclib.
Preparing to unpack .../10-php-phpseclib_2.0.9-1_all.deb ...
Unpacking php-phpseclib (2.0.9-1) ...
Selecting previously unselected package php-tcpdf.
Preparing to unpack .../11-php-tcpdf_6.2.13+dfsg-1ubuntu1_all.deb ...
Unpacking php-tcpdf (6.2.13+dfsg-1ubuntu1) ...
Selecting previously unselected package phpmyadmin.
Preparing to unpack .../12-phpmyadmin_4%3a4.6.6-5_all.deb ...
Unpacking phpmyadmin (4:4.6.6-5) ...
Setting up libjs-jquery (3.2.1-1) ...
Setting up php-tcpdf (6.2.13+dfsg-1ubuntu1) ...
Setting up php-phpseclib (2.0.9-1) ...
Setting up libjs-underscore (1.8.3~dfsg-1) ...
Setting up libjs-sphinxdoc (1.6.7-1ubuntu1) ...
Setting up php-mbstring ( ...
Setting up php-pear ( ...
Setting up javascript-common (11) ...
apache2_invoke: Enable configuration javascript-common
Setting up dbconfig-common (2.0.9) ...

Creating config file /etc/dbconfig-common/config with new version
Setting up dbconfig-mysql (2.0.9) ...
Setting up php-php-gettext (1.0.12-0.1) ...
Setting up phpmyadmin (4:4.6.6-5) ...
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf

Creating config file /etc/dbconfig-common/phpmyadmin.conf with new version

Creating config file /etc/phpmyadmin/config-db.php with new version
ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES).
unable to connect to mysql server.
error encountered creating user:
ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

Progress: [ 94%] [######################################################....] 
Package configuration

 ┌────────────────────────┤ Configuring phpmyadmin ├─────────────────────────┐
 │                                                                           │ 
 │ An error occurred while installing the database:                            
 │ ERROR 1045 (28000): Access denied for user                                  
 │ 'debian-sys-maint'@'localhost' (using password: YES) . Your options are:    
 │  * abort - Causes the operation to fail; you will need to downgrade,        
 │    reinstall, reconfigure this package, or otherwise manually intervene     
 │    to continue using it. This will usually also impact your ability to      
 │    install other packages until the installation failure is resolved.       
 │  * retry - Prompts once more with all the configuration questions           
 │    (including ones you may have missed due to the debconf priority          
 │    setting) and makes another attempt at performing the operation.          
 │  * retry (skip questions) - Immediately attempts the operation again,       
 │    skipping all questions. This is normally useful only if you have         
 │                                  <Ok>                                       
 │                                                                           │ 

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there @erhanpaker1,

This is a problem with the WordPress 1-Click installation image, I can confirm that it has already been reported and worked on.

In the meantime, I could suggest installing phpMyAdmin manually. You can do that by following the steps from this answer here:

Hope that this helps! Regards, Bobby