Question

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

Posted April 13, 2020 5.1k views
DigitalOcean Articles

Hi, I’m getting an error

https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-18-04

Last login: Mon Apr 13 12:36:35 on ttys000
Mars-MBP:~ Mars$ ssh root@165.227.54.45
The authenticity of host '165.227.54.45 (165.227.54.45)' 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 '165.227.54.45' (ECDSA) to the list of known hosts.
root@165.227.54.45'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:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  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: 165.227.54.45
  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: http://do.co/wordpress#start
 * The new WordPress site: http://165.227.54.45

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
   /var/www/html/wp-content/mu-plugins/fail2ban.php
 * Certbot is preinstalled. Run it to configure HTTPS. See
   http://do.co/wordpress1804#enable-https for more detail.
 * For security, xmlrpc calls are blocked by default.  This block can be
    disabled by running "a2disconf block-xmlrpc" in the terminal.

IMPORTANT:
   After connecting to the Droplet for the first time,
   immediately add the WordPress administrator at http://165.227.54.45.

For help and more information, visit http://do.co/wordpress1804

********************************************************************************
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. example.org or test.example.org) do not include www or http/s
--------------------------------------------------
Domain/Subdomain name: munichescort.com
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: 912mars912@gmail.com

Username: london

Password: 

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/wp_setup.sh: line 94: break: only meaningful in a `for', `while', or `until' loop
Finalizing installation...
--2020-04-13 09:54:23--  https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.188.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.188.133|: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 (4.2.7.1)
Downloading installation package from https://downloads.wordpress.org/plugin/wp-fail2ban.4.2.7.1.zip...
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 https://repos.insights.digitalocean.com/apt/do-agent main InRelease
Get:2 http://mirrors.digitalocean.com/ubuntu bionic InRelease [242 kB]         
Hit:3 http://mirrors.digitalocean.com/ubuntu bionic-updates InRelease          
Hit:4 http://mirrors.digitalocean.com/ubuntu bionic-backports InRelease        
Hit:5 http://repo.mysql.com/apt/ubuntu bionic InRelease                        
Hit:6 http://ppa.launchpad.net/certbot/certbot/ubuntu bionic InRelease         
Get:7 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]    
Hit:8 http://ppa.launchpad.net/ondrej/php/ubuntu 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
  php-tcpdf
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 http://mirrors.digitalocean.com/ubuntu bionic/main amd64 dbconfig-common all 2.0.9 [601 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 dbconfig-mysql all 2.0.9 [1038 B]
Get:3 http://mirrors.digitalocean.com/ubuntu bionic/main amd64 javascript-common all 11 [6066 B]
Get:4 http://mirrors.digitalocean.com/ubuntu bionic/main amd64 libjs-jquery all 3.2.1-1 [152 kB]
Get:5 http://mirrors.digitalocean.com/ubuntu bionic/main amd64 libjs-underscore all 1.8.3~dfsg-1 [59.9 kB]
Get:6 http://mirrors.digitalocean.com/ubuntu bionic/main amd64 libjs-sphinxdoc all 1.6.7-1ubuntu1 [85.6 kB]
Get:7 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 php-php-gettext all 1.0.12-0.1 [16.2 kB]
Get:8 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 php-gettext all 1.0.12-0.1 [1508 B]
Get:9 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 php-phpseclib all 2.0.9-1 [176 kB]
Get:10 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 php-tcpdf all 6.2.13+dfsg-1ubuntu1 [7791 kB]
Get:11 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 phpmyadmin all 4:4.6.6-5 [3861 kB]
Get:12 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 php-pear all 1:1.10.8+submodules+notgz-1+ubuntu18.04.1+deb.sury.org+1 [286 kB]
Get:13 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 php-mbstring all 2:7.4+75+ubuntu18.04.1+deb.sury.org+1 [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 .../06-php-pear_1%3a1.10.8+submodules+notgz-1+ubuntu18.04.1+deb.sury.org+1_all.deb ...
Unpacking php-pear (1:1.10.8+submodules+notgz-1+ubuntu18.04.1+deb.sury.org+1) ...
Selecting previously unselected package php-mbstring.
Preparing to unpack .../07-php-mbstring_2%3a7.4+75+ubuntu18.04.1+deb.sury.org+1_all.deb ...
Unpacking php-mbstring (2:7.4+75+ubuntu18.04.1+deb.sury.org+1) ...
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 (2:7.4+75+ubuntu18.04.1+deb.sury.org+1) ...
Setting up php-pear (1:1.10.8+submodules+notgz-1+ubuntu18.04.1+deb.sury.org+1) ...
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>                                       
 │                                                                           │ 
 └───────────────────────────────────────────────────────────────────────────┘ 
edited by MattIPv4

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.

×
1 answer

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:

https://www.digitalocean.com/community/questions/how-to-install-manually-phpmyadmin-on-ubuntu

Hope that this helps!
Regards,
Bobby

  • Any idea when the WordPress 1-Click installation image will be fixed? Still having the same issue and we’re 5 months after this reply…

    Thanks!

Submit an Answer