Thiết lập môi trường

Truy cập MariaDB từ xa trên Centos

Truy cập MariaDB từ xa trên Centos

Đăng nhập vào SQL:

mysql -u root -p

Thêm tài khoản SQL

GRANT ALL PRIVILEGES ON *.* TO 'remoteuser'@'%' IDENTIFIED BY 'new_password' WITH GRANT OPTION;

Cho phép tài khoản truy cập từ xa

GRANT ALL PRIVILEGES ON *.* TO 'remoteuser'@'192.168.52.43' IDENTIFIED BY 'new_password' WITH GRANT OPTION;

Lệnh cuối cùng để apply

FLUSH PRIVILEGES;

#Open MySQL Port

# open port

sudo firewall-cmd --permanent --add-port=3306/tcp

# reload

sudo firewall-cmd --reload

 


Chia sẻ bài viết:
Bình luận trực tiếp trên web
Bài viết liên quan
Cài MariaDB trên Centos 7

Cài MariaDB trên Centos 7

Cài MariaDB trên Centos 7

07-08-2022 · Thiết lập môi trường · 1 phút đọc · 979