0

I was trying to get access to my DB from my second machine via Wi-Fi. I thought if I change root@localhost to root@0.0.0.0 it will allow me to connect to db. But I was wrong. Now I can't connect to my DB neither from localhost and second machine.

How to switch root@0.0.0.0 to root@localhost? I know the root password. Thank you in advance!

Shadow
  • 33,525
  • 10
  • 51
  • 64
Nastro
  • 1,719
  • 7
  • 21
  • 40
  • see [How to Reset the Root Password](https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html) .. Stop and start the MySQL server with `--skip-grant-tables` then you should also be able to reconfigure the root account host again and or add `root@localhost` again – Raymond Nijland Mar 07 '19 at 17:29
  • it this way the data will be safe? – Nastro Mar 07 '19 at 17:30
  • not if the MySQL server is directly accessible from SQL clients from the outside (over the internet).. – Raymond Nijland Mar 07 '19 at 17:32
  • It's not dublicate because the problem not in passwords. The problem in 0.0.0.0 or localhost. How to change it? – Nastro Mar 07 '19 at 19:50
  • 1
    Geuss you didn't understand it? boot MySQL with `--skip-grant-tables` then you can update in the `mysql.user` table that account `root@0.0.0.0` to `root@localhost` with a simple update query and then start the server without using `--skip-grant-tables` – Raymond Nijland Mar 07 '19 at 19:58
  • Thanks! I did it – Nastro Mar 07 '19 at 20:18

0 Answers0