MySQL Error Nr. 1045 Access denied for user 'root'@'192.168.0.28' (using password: YE
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
When you don't specify the host, mysql will try to access the daemon through a socket file. When you do specify the host ("-h 192.168.0.28"), the daemon will be accessed through the network interface. Assuming that 192.168.0.28 is the local server, you will need to specificaly grant access through the network interface. This is done with "GRANT ... ON ... TO root@192.168.0.28;"
When you don't specify the host, mysql will try to access the daemon through a socket file. When you do specify the host ("-h 192.168.0.28"), the daemon will be accessed through the network interface. Assuming that 192.168.0.28 is the local server, you will need to specificaly grant access through the network interface. This is done with "GRANT ... ON ... TO root@192.168.0.28;"
Hi chris
can u tell me how to apply privileges
mysql>grant all privileges on *.* root@192.168.0.28;
but at that time i am getting below error
##########################
MySQL Error Nr. 2003
Can't connect to MySQL server on '192.168.0.28' (111)
##########################
if i use
#mysql -h 127.0.0.1 -u <root> -p <password>
Not a connection issue, I think; command is incorrect.
Code:
grant all privileges on *.* to root@192.168.0.28 identified by 'password'
A while ago that I used it, so there might be a mistake in the syntax.
Notes:
1) I don't advise to allow mysql root access via the network for security reasons; I only allow mysql root access from the physical machine (or via SSH from remote machines)
2) With the given command, your root user that connects via the network will not be able to grant permissions (which is -again- very advisable in my opinion).
Not a connection issue, I think; command is incorrect.
Code:
grant all privileges on *.* to root@192.168.0.28 identified by 'password'
A while ago that I used it, so there might be a mistake in the syntax.
Notes:
1) I don't advise to allow mysql root access via the network for security reasons; I only allow mysql root access from the physical machine (or via SSH from remote machines)
2) With the given command, your root user that connects via the network will not be able to grant permissions (which is -again- very advisable in my opinion).
Hi Thanks for reply
ISolved the problem. when i change in /etc/my.cnf file bind-address=192.168.0.28 and i have applied privileges at that time
#mysql -h 192.168.0.28 -u root -p <password>
above the command is working.
can any body tell how add one more ip because 192.168.0.28 is my local ip if i change ip in /etc/my.cnf the mysqld daemon is not starting.
To my knowledge, you can't. The server can only listen on one address / port combination. So you have to start a second server (mysqld) with a different configuration.
But I'm actually missing what your trying to achieve. If you want to connect from multiple machines to this server, you have achieved what you wanted. The rest should be solvable with the grant command.
If you leave out the "bind-address", the daemon will listen on all interfaces by default. If you want to specifically tell it to listen on all interfaces, you can use "bind-address=0.0.0.0". You stated that when you change the IP in my.cnf, the daemon will not start. What are you changing it to? It must be an IP local to the server.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.