Answers for "mysql allow only local connections"

SQL
0

mysql allow only local connections

If you restrict access from remote hosts to your usernames and passwords then someone won't be able to access the database externally.

You could also configure your firewall to only allow traffic to 3306 (MySQL Default Port) from the localhost machine.

Update

To setup your user so they can only access through LOCALHOST use:

GRANT ALL PRIVILEGES ON *.* TO db_user @'localhost' IDENTIFIED BY 'db_passwd';
GRANT ALL PRIVILEGES ON *.* TO db_user @'127.0.0.1' IDENTIFIED BY 'db_passwd';
Also, bind your MySQL server to the local address. You can do this by editing the [mysqld] section of my.cnf:

[mysqld]
bind-address = 127.0.0.1
Posted by: Guest on April-26-2021

Code answers related to "mysql allow only local connections"

Code answers related to "SQL"

Browse Popular Code Answers by Language