Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
How to enable direct access to phpMyAdmin skipping phpMyAdmin login via Plesk URL? (Tools & Settings > Database Servers > Clicking on )
Answer
It is possible to enable direct access to phpMyAdmin over the URL link: https://plesk.example.com:8443/phpmyadmin
Note: The database user login and password are still required to log in phpMyAdmin.
Follow these steps to enable direct access to the phpMyAdmin login page:
-
Go to Extensions > My Extensions > Panel.ini Editor > Editor tab add the following lines in the Content section > then Click Save:
[databaseManagement]
features.phpMyAdmin.loginForm.enabled = on -
Access phpMyAdmin login page by browsing the following URL:
https://plesk.example.com:8443/phpmyadmin
Note: If the URL shows an error, clear the browser cache and cookies.
(Optional in Linux) In order to make the phpMyAdmin URL be like mysql.example.com-
Go to Plesk > Domains and create a domain named mysql.example.com (replace example with the actual domain's name);
-
Go to Domains > mysql.example.com > Hosting Settings disable PHP support press OK to apply the settings
-
Go to Domains > mysql.example.com > Apache & nginx Settings disable Proxy mode press Aplly to save the settings
-
Under Additional nginx directives add the following code and press OK to apply the settings
Note: Replace plesk.example.com with the hostname of the server
server_tokens off;
location / {
proxy_pass https://example.com:8443/phpMyAdmin/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_read_timeout 1200s;
}
location /phpMyAdmin {
proxy_pass https://example.com:8443;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_read_timeout 1200s;
}
-
-
The phpMyAdmin login page will appear. Log in with the database username and password:
Note: If the error "Cannot connect: invalid settings." appears, restore the original panel.ini file or make sure that it is correct:
-
Rename the existing file panel.ini:
# mv /usr/local/psa/admin/conf/panel.ini{,.old}
-
Copy it from the template:
# cp /usr/local/psa/admin/conf/panel.ini.sample /usr/local/psa/admin/conf/panel.ini
-
Edit the file using vi and add the lines for 4. at the end:
# cat -n /usr/local/psa/admin/conf/panel.ini | tail -n 2
74 [databaseManagement]
75 features.phpMyAdmin.loginForm.enabled = onIt should look like the following in Panel.ini editor:
Comments
14 comments
With Firefox the following link may also help:
https://<Plesk-server-host-name-or-IP>/domains/databases/phpMyAdmin/index.php?db=databasename
@Peter
I order to use this link it is required to log in to Plesk as 'admin' user first.
How to custom the phpmyadmin url port?
Can I specify the phpmyadmin port to 80?
Hello @Leon,
Thank you for your question.
Currently there is no possibility to customize the port for PHPMyAdmin.
As the feature that you have reported is yet to be implemented in Plesk, I suggest you to take part in our product improvement by referring to the following link: Customize port for PHPMyAdmin
Hey is it possible to get it work that all of the domains in plesk can have this /phpmyadmin serverAlias?
Hello @Melvin Seddig,
Thank you for you question.
Currently it is possible to access phpMyAdmin using Plesk server hostname or IP address only.
Can you tell me if i enable this option may i face any security problem?
Hello Shipon Karmakar
This won't bring any security issues, feel free to use this instruction.
Couple of things.
To access with plesk.yourdomain.com:8443/phpmyadmin you need to create an A record otherwise you get DNS errors
Omit plesk. and replace yourdomain with server IP, finally got me the phpMyAdming login page showiing and I could login.
However,
Is there a possibility to access phpMyAdmin server wide like WHM cPanel allows? That would be a great improvement because on one website I may have several databases and instead having to login logout login all the time, it would allow me to just choose the relevant database I need to work on, withing phpMyAdmin.
?
Thanks.
Hi JuJue Holistic Wellness,
To access all databases from a database server vía PHPMyAdmin, you must log in to Plesk and go to Tools & Settings > Database Servers, on the right side you have the button to open PHPMyAdmin as admin.
When logging in to phpMyAdmin directly, are failed logins logged anywhere?
@Jennifer Arsenault
Sure, the failed login attempt will appear in /var/log/secure on Red Hat based OSes, similar to:
phpMyAdmin[1500]: user denied: testuser (mysql-denied) from 127.0.0.1
Hi,
in my opinion there are still two small steps to do to fix it:
- Create a DNS record to point to mysql.domainname.com (as indicated by @Norbert Harms)
- and. in my case there was an SSL error (which can be seen in the logs files) like
therefore the following line must be added:
proxy_ssl_server_name on;
here is the complete code:
server_tokens off;
location / {
proxy_ssl_server_name on;
proxy_pass https://example.com:8443/phpMyAdmin/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_read_timeout 1200s;
}
location /phpMyAdmin {
proxy_ssl_server_name on;
proxy_pass https://example.com:8443;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_read_timeout 1200s;
}
The same problem happens to the Plesk extension "grafana", asked in the plesk community forum as well (https://talk.plesk.com/threads/grafana-extension-how-to-log-in-to-grafana-outside-of-plesk.364094/ ) Is there a possiblity to duplicate this procedure to other extensions then phpmyadmin (for example grafana)?
Please sign in to leave a comment.