# phpMyAdmin Login
Generate a one-click phpMyAdmin login URL for a database user.
The server must use MySQL or MariaDB. The selected application must be a phpMyAdmin application on the same server as the database user. The database user connection preference must be localhost or everywhere.
The returned URL is valid for 1 minute. Open it in a browser to sign in to phpMyAdmin without entering database credentials manually.
# Generate phpMyAdmin Login URL
# HTTP Request:
POST https://api.serveravatar.com/organizations/{organization}/servers/{server}/phpmyadmin/login
# Parameter:
| Parameter | Required | Type | Description |
|---|---|---|---|
| database_user_id | Yes | Integer | Database user id from List Database Users. |
| application_id | Yes | Integer | phpMyAdmin application id from Server Application List. |
# Curl Request Example:
curl --request POST \
--url "https://api.serveravatar.com/organizations/5/servers/15/phpmyadmin/login" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>' \
--data '{
"database_user_id": 42,
"application_id": 93
}'
# Response:
# Successful Response
- 200 (Ok)
{
"url": "http://example.com/pma-login.php?token=9ca0e547-3h76-490c-a9d3-f76a0b5dkb47&report_url=api.serveravatar.com",
"message": "PHPMyAdmin login URL generated successfully."
}
Open the url in a browser before it expires.
# Validation Error
- 422 (Unprocessable Entity)
{
"message": "The database user id field is required."
}
# Server Error
- 500 (Internal Server Error)
{
"message": "Something went really wrong while generating phpMyAdmin login URL."
}
Other possible error messages:
Application is not associated with the server.Application and database user must belong to the same server.Selected database user must belong to a MySQL or MariaDB server.Selected database user connection preference must be localhost or everywhere.Selected application must be a phpMyAdmin application.