unable to connect to localhost mysql workbench
# open mysql conf file
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
# replace bind-address from 127.0.0.1 to 0.0.0.0
"""
bind-address = 0.0.0.0
"""
# login to mysql
sudo mysql
# create a Database
CREATE DATABASE db_name;
# allow a full access to a specific user for a specific db
GRANT ALL ON db_name.* TO user_name@'%' IDENTIFIED BY 'user_password';
GRANT ALL PRIVILEGES ON db_name.* TO 'user'@'hostname' ; # when password is already created
# exit mysql
exit
# open up port 3306 for every one
sudo ufw allow 3306
# restart mysql
sudo systemctl restart mysql
# check from some external client to connect to this mysql. it should be successful
Comments
Post a Comment