Allow Remote Access MySQL in Debian 11
Before start, confirm MySQL is installed in your server. If installed, you can follow this step. First move to MySQL directory, then open mysqld.cnf file.
cd /etc/mysql/mysql.conf.dOpen mysqld.cnf file with nano/vim.
nano mysqld.cnfsearch bind-address config, then replace with 0.0.0.0. Thats mean allow connection to MySQL service from anywhere.
bind-address = 0.0.0.0then restart mysql service.
systemctl restart mysqlCreate User
Get Rahmat Aulia’s stories in your inbox
Join Medium for free to get updates from this writer.
The best practice, you should create new user than using root for remote access.
CREATE USER 'username'@'%' IDENTIFIED BY 'password';GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;FLUSH PRIVILEGES;Check Connection
So, check the connection between your host to server/local. If success you can using the user you have created.





