Previously I had shown..
- How to Install Linux on Raspberry Pi 3
- How to Install .Net Core 3.1 on Raspberry Pi 3
- ln: failed to create symbolic link '/usr/bin/dotnet/dotnet': File exists
- How to ADD static IP Address in Raspberry Pi
- How to Install MySQL/MariaDB in Raspberry Pi
- How to create a new user and grant permissions in MySQL
Config file Paths in different operating systems. Lets check the paths as shown and open in nano using below command
MySQL in Ubuntu 16:
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
MariaDB in Raspberry Pi:
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
Locate bind-address and change as shown. This will allow to connect with any IP address
bind-address = 0.0.0.0
Now restart mysql.
sudo systemctl restart mysql.service
sudo systemctl restart mariadb.service
Now login to MySQL with root
mysql -u root -p
Now grant permission as shown
GRANT ALL privileges ON *.* TO username@'%' IDENTIFIED BY 'user_password';
FLUSH PRIVILEGES;
quit;
Ones again restart MySQL
sudo systemctl restart mariadb.service
Now connect with Mysql GUI tools from other computers. Here I'm using HeidiSQL.[Note:] Hostname/IP = MySQL Installed OS IP Address.
Command to connect
mysql -h mysql server ip -u root -p
Ex: mysql -h 192.168.1.20 -u root -p
No comments:
Post a Comment