How do I open up my MySQL on my Raspberry Pi for Outside / Remote Connections?

后端 未结 3 1175
再見小時候
再見小時候 2020-12-05 04:48

I have a Raspberry Pi that stores temperature data for homebrewing activity. I am making a Spring MVC application on my computer and I want to tap the data. Both my Pi and m

3条回答
  •  囚心锁ツ
    2020-12-05 05:44

    If your issue is not able to remotely connect with MySQL on Raspberry Pi, then try below steps. I had the same issue and got it resolved by performing below commands.

    1) sudo nano /etc/mysql/my.cnf

    2) # bind-address = 127.0.0.1 // comment this line out

    bind-address = 0.0.0.0          //add this line just below above line 
    

    3) sudo /etc/init.d/mysql restart //restart mysql

    4) sudo mysql -u root -p //login to mysql cli as user 'root'

    5) GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'beta' WITH GRANT OPTION;

    Here 'root' is the mysql user and 'beta' is the password and here privileges are set for 'root'.Change it accordingly and execute above query in mysql cli.

    Good Luck !!!

提交回复
热议问题