I'm having a major problem getting phpmyadmin working again (it used to work on 16.04). I upgraded Ubuntu 16.04 to 20.04 yesterday and got the following versions of stuff:
MySQL 8.0.23-0ubuntu0.20.04.1 for Linux on x86_64 PHP7.4-fpm Apache 2.4.41 phpmyadmin 4:4.9.5+dfsg1-2
When I go to my usual phpmyadmin page, like "mysql.mysite.com", I receive a 503 Service Unavailable error. The rest of my websites are mostly working fine (except for non-existing php pages showing up as "No input file specified." instead of 404).
Note that my web/phpmyadmin server is SEPARATE from the MySQL server which is on a different IP and server instance (also running on Ubuntu 20.04).
Things I've read about in a variety of forums and tried, but they haven't worked:
I've uninstalled and reinstalled mysql-server and phpmyadmin
I've started/restarted mysql and ensured that it is running (the rest of my websites run fine)
Set in my.cnf: default_authentication_plugin = mysql_native_password
I've run "sudo dpkg-reconfigure phpmyadmin". Setting TCP/IP the and selected the Host name to be IP address of my database server. When I use 'root' and the admin username, I get this error: "ERROR 1045 (28000): Access denied for user 'root'@'(web-server-IP-address)'"
I have another "admin" username in MySQL, configured to be used on my web/phpmyadmin IP address, and entering the password once works, but then the program asks for it a second time, and I get this error: " ERROR 1045 (28000): Access denied for user 'phpmyadmin'@'web-server-IP-address'"
- In apache, I added "Include /etc/phpmyadmin/apache.conf" to /etc/apache2/apache2.conf
6 Also in apache, I added the following after " DocumentRoot /var/www/html" in 000-default.conf:
<Directory "/var/www/html"> AllowOverride All </Directory>
7 I also did "sudo a2enconf phpmyadmin.conf" and can confirm that it's it the conf-enabled folder, and restarted apache2.
The /etc/apache2/conf-available/phpmyadmin.conf has the following content:
In one of mysite.com.conf files, I have the subdomain phpmyadmin set up as:
<VirtualHost *:443> ..... ServerName mysql.mysite.com DocumentRoot /usr/share/phpmyadmin <Directory /usr/share/phpmyadmin> Options FollowSymLinks DirectoryIndex index.php AllowOverride None </Directory> ..... </VirtualHost>
I've been at it for 2 days now, none of this had no effect at all and the 503 service unavailable error just persists on my mysql.mysite.com phpmyadmin page. What should I try next?
I finally had success with "sudo dpkg-reconfigure phpmyadmin". I manually created the phpmyadmin user on the MySQL server and gave it all privileges to the phpmyadmin database. After running "sudo dpkg-reconfigure phpmyadmin" on the web server, it goes all the way through with the results:
dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf phpmyadmin already exists and has privileges on phpmyadmin. dbconfig-common: dumping mysql database phpmyadmin to /var/tmp/phpmyadmin.phpmyadmin.2021-04-30-04.23.mysql.VeEHd6. dbconfig-common: dropping old mysql database phpmyadmin. dropping database phpmyadmin: success. verifying database phpmyadmin was dropped: success. creating database phpmyadmin: success. verifying database phpmyadmin exists: success. populating database via sql... done. dbconfig-common: flushing administrative password
Unfortunately, I'm still stuck with a 503 service unavailable...
UPDATE 2 Narrowed things down some more. I found during a test that this will work if the DirectoryIndex is an HTML file instead of a PHP file:
<VirtualHost *:80> ..... ServerName mysql.mysite.com DocumentRoot /usr/share/TEST # test directory <Directory /usr/share/TEST> Options FollowSymLinks DirectoryIndex index.html # index.html contains the text "test" AllowOverride None </Directory> ..... </VirtualHost>
However, it will not run a simple one-line index.php file, which results in a 503 Service Unavailable error. Again, the rest of my php files work on my main sites, but it's not running phpmyadmin or any php file through this subdomain setup. It seems like there is probably a really simple solution, but I just don't know enough about apache/php setups.