If I do SHOW GRANTS
in my mysql database I get
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost'
IDENTIFIED BY PASSWORD 'some_characters'
WITH GRANT OPTION
If I am not mistaken, root@localhost
means that user root
can access the server only from localhost
. How do I tell MySQL to grant root
the permission to access this mysql server from every other machine (in the same network), too?
This worked for me. But there was a strange problem that even I tryed first those it didnt affect. I updated phpmyadmin page and got it somehow working.
If you need access to local-xampp-mysql. You can go to xampp-shell -> opening command prompt.
Then mysql -uroot -p --port=3306 or mysql -uroot -p (if there is password set). After that you can grant those acces from mysql shell page (also can work from localhost/phpmyadmin).
Just adding these if somebody find this topic and having beginner problems.
*.* = DB.TABLE
you can restrict user to specific database and specific table.'root'@'%'
you can change root with any user you created and % is to allow all IP. You can restrict it by changing %.168.1.1 etc too.This grants root access with the same password from any machine in
*.example.com
:If name resolution is not going to work, you may also grant access by IP or subnet:
MySQL
GRANT
syntax docs.Open the
/etc/mysql/mysql.conf.d/mysqld.cnf
file and comment the following line:Try:
You need to take some steps to make sure first mysql and then root user is accessible from outside:
Disable
skip-networking
inmy.cnf
(i.e:/etc/mysql/my.cnf
)Check value of
bind-address
inmy.cnf
, if it's set to127.0.0.1
, you can change it to0.0.0.0
to allow access from all IPs or whatever ip that you want to connect from.Grant remote access the root user from any ip (or specify your ip instead of
%
)Restart mysql service: