After setting up a Linux server and install MySql as a database engine, we usually are restricted to the local users. For a WordPress or a Nextcloud installation, this is not an issue. But if you want to access the MySql database from another computer, using phpMyAdmin, you get an error.
To go around this error, and have access to the database, we need to change one parameter in the MySql configuration file:
sudo nano mysqld.cnf
In the file, replace the bind-address from 127.0.0.1 to 0.0.0.0, and mysql database can be accessed from anywhere.
Also, the user needs to have granted all privileges to a database in order to access it remotely.