LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 03-31-2013, 10:53 AM   #1
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Rep: Reputation: 121Reputation: 121
mysql root password on specified host (not localhost)


I've lost the root user password on my mythtv database server. I first noticed a problem when updating packages and getting a complaint from mythtv-database. I tried to run "dpkg-reconfigure --force mythtv-database" and got an error. I am running debian squeeze.

I've gone through the procedures to reset the root password using mysqld-safe, and it works for localhost. But, when I try "mysql -h192.168.0.4 -uroot -proot mysql" I get the following:
Code:
ERROR 1045 (28000): Access denied for user 'root'@'192.168.0.4' (using password: YES)
NOTE: My machine address is 192.168.0.4.
 
Old 03-31-2013, 12:03 PM   #2
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Undecided
Posts: 3,499
Blog Entries: 6

Rep: Reputation: Disabled
try -h 127.0.0.1 or even
-h localhost

192.168.0.4 is NOT the localhost even if it resolves locally and I believe it has something to do with /etc/my.cnf
 
Old 03-31-2013, 12:19 PM   #3
rigor
Member
 
Registered: Sep 2011
Posts: 152

Rep: Reputation: Disabled
Quakeboy02,

The user table in the database named mysql can be used to identify the "host" associated with a particular attempt to access the DB. It is the combination of host and user that is used to control access. So if myth is using the specific host IP rather than the string "localhost", it could be locked out. The same thing applies to any attempt to access mysql from the command line. When you reset the root/admin password for the local host, you might need to use that admin access from the local host, to reset the password for admin access from 192.168.0.4, depending on how the DB was set up.

In general, if the IP you mentally associate with your machine is 192.168.0.4, thinking of that as different than "localhost" is not necessarily intuitive, but computers are more literal minded than Humans. As Habitual effectively indicated, with Linux the string "localhost" tends to be associated with the IP 127.0.0.1.
 
Old 03-31-2013, 12:32 PM   #4
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Original Poster
Rep: Reputation: 121Reputation: 121
Guys. I understand that 192.168.0.4 is not localhost. That's why I was careful to point out the problem is attached to 192.168.0.4. The problem is that I don't know what to do with that information. How, exactly, do I set the root password on 192.168.0.4?
 
Old 03-31-2013, 01:05 PM   #5
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Original Poster
Rep: Reputation: 121Reputation: 121
Oh duh! I figured it out. Execute the following as root in the localhost database connection:
Code:
mysql > update user set password=PASSWORD("root") where user="root@192.168.0.4";
mysql > flush privileges;
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MYSQL: Access denied for user 'root'@'localhost' (using password: NO) jun_tuko Linux - Software 3 03-05-2013 06:37 AM
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) bobby953 Linux - Software 21 03-24-2011 08:35 PM
[SOLVED] mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: 124vikas.dange@gmail.com Linux - Server 4 11-19-2010 01:36 AM
Mysql error 1045: Access denied for user 'root'@'localhost' (using password: YES) visitashu Linux - Server 15 11-10-2010 11:05 PM
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) shogun1234 Linux - Server 1 06-15-2009 11:12 AM


All times are GMT -5. The time now is 12:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration