Since Artica 4.50 HotFix 20230911-11 or Service pack 1, the Web API service lets you perform maintenance and monitoring operations on the MySQL/MariaDB service.
http://[server]:[port]/mysql/service/restart
http://[server]:[port]/mysql/service/processes
http://[server]:[port]/mysql/users
give a json with a “Users
” attribute that lists all privileges and users.
{
"Status": true, "Error": "",
"Users": [ {
"Reload_priv": "N",
"File_priv": "N",
"Create_tmp_table_priv": "N",
. . . / . . .
"User": "mariadb.sys",
},
POST http://[server]:[port]/mysql/users/create
Using fields :
Example: curl -d "User=user1&Host=%&Password=pass1" -X POST http://[server]:[port]/mysql/users/create
POST http://[server]:[port]/mysql/users/grant
Using fields :
Example: curl -d "User=user1&Host=%" -X POST http://[server]:[port]/mysql/users/grant
POST http://[server]:[port]/mysql/users/revoke
Using fields :
Example: curl -d "User=user1&Host=%" -X POST http://[server]:[port]/mysql/users/revoke
POST http://[server]:[port]/mysql/user/[username]/[host]
Example: curl http://[server]:[port]/mysql/user/root/localhost
http://[server]:[port]/mysql/user/[username]/[host]/privileges
Example: curl http://[server]:[port]/mysql/user/dbuser/%/privileges
http://[server]:[port]/mysql/database/grant/[database]/[username]/[host]
Example: curl http://[server]:[port]/mysql/database/grant/phpmyadmin/admin/localhost
http://[server]:[port]/mysql/database/revoke/[database]/[username]/[host]
Example: curl http://[server]:[port]/mysql/database/revoke/phpmyadmin/admin/localhost
http://[server]:[port]/mysql/databases
Example: curl http://[server]:[port]/mysql/databases
http://[server]:[port]/mysql/database/create/[database]
Example: curl http://[server]:[port]/mysql/database/create/myDB
POST http://[server]:[port]/mysql/database/delete/[database]
Example: curl http://[server]:[port]/mysql/database/delete/myDB