1.install mysql on your server
2.Configure MySQL to allow access from all IP addresses. If you are not sure where the configuration file is located, you can use the following commands to locate it:
First, use which mysql
to find the base directory of MySQL.
Then, use /usr/bin/mysql --verbose --help | grep -A 1 'Default options'
to identify the potential paths of the configuration files.
In the configuration file, add bind-address = 0.0.0.0
to ensure that users from all IP addresses can access the database
3. if you have set up a firewall, open the corresponding ports(same as your server configuration)