English Czech
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.
Allow Access
GRANT ALL PRIVILEGES ON *.* TO 'your_username'@'%';
IDENTIFIED BY 'my-new-password' WITH GRANT OPTION;
#OR
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)
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.100.%'
IDENTIFIED BY 'my-new-password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Connecting
mysql -u [USER] -h [IP] -p