English Czech
you can ensure that with the following command `rpm -qc [package]`.
systemctl restart firewalld.service
sudo systemctl restart {mysqld|mariadb}
sudo firewall-cmd --permanent --zone=public --add-service=mysql
sudo firewall-cmd --permanent --zone=public --add-port=3306/tcp
Restart firewalld.service
Replace your_username and your_password depending on what you want the username and password to be. Here, host_ip_addr is the hostname or IP address of the computer from where you want to connect to the MySQL/MariaDB server. You can also use % as host_ip_addr if you want to connect from any computer. It can also be something like 192.168.2.% if you want to connect from computers from the IP range 192.168.2.1 – 192.168.2.254.
#OR
## OR ##
Open SQL port (3306) on FireWalld:
Navigate to the line that begins with the bind-address directive. It will look like this: you could set this directive to a wildcard IP address, either *, ::, or 0.0.0.0:
mysql -u [USER] -h [IP] -p
MySql -> `/etc/my.cnf/`
MySql Community -> `/etc/my.cnf.d/community-mysql-server.cnf`
MariaDB -> `/etc/my.conf`
It is common for people to want to create a "root" user that can connect from anywhere, so as an example, we'll do just that, but to improve on it we'll create a root user that can connect from anywhere on the local area network (LAN)
How To Allow Remote Access MYSQL/MariaDB/MYSQL Community
GRANT ALL PRIVILEGES ON *.* TO 'your_username'@'%';
IDENTIFIED BY 'my-new-password' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.100.%'
IDENTIFIED BY 'my-new-password' WITH GRANT OPTION;
FLUSH PRIVILEGES;