This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

MySQL Linux Administration Question

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure if this is the proper forum, but I'll start here....

I just installed MySQL 5 in Debian Linux and have a question regarding root access. I followed the installation instructions to a tee and can confirm that the server is running. The one issue that I'm finding is that I can only run the core mysql applications (mysql, mysqlshow, mysqladmin) only as the Linux root user AND if I explicitly state the hostname with the -h option. If I try and launch these apps with any Linux user other than root OR if I don't specify the hostname, I get the following error:

prompt> mysql -u root -p mysql
Password: *****
"Access Denied for user ''@'localhost' (using PASSWORD:YES)"

If I type the following, I can get in:
prompt> mysql -u root -p -h [myhostname] mysql

Again, even as Linux root user, if I don't specify the hostname I get the same error message.

Not sure what I need to do to resolve this....or is this even an issue?

Just for reference, here's some other information:

"select user, host from user" on mysql database, I get the following
root | 127.0.0.1
root | localhost
root | [myhostname]

My /etc/hosts file looks like

127.0.0.1 localhost localhost
192.186.1.50 [myhostname] [myhostname]

Based on all the documentation I've read so far, not many installations require the -h option. Just want to make sure I don't run into any connection problems when I start connecting this instance to my java app through the connectors.

Thanks,
Scott
 
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://dev.mysql.com/doc/refman/5.0/en/access-denied.html
 
Scott Updike
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I bet I've read that a 1000 times but I still can't seem to find what I'm looking for. Let's take a step back and I'll ask a more fundamental question:

what is preventing other Linux accounts from running mysql, mysqladmin, or mysqlshow even when they use the "-h [myhostname]" option? So far only the Linux superuser root account can run these programs.

I've made sure that everything is owned by the mysql user.

Scott
 
Sheriff
Posts: 22645
124
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I recall correctly, some MySQL installations have a default blank password for root - one of the first things to fix.

That's probably why "mysql -u root -p -h [myhostname] mysql" is working - the "mysql" is not directly after the "-p" option, so it is NOT the password you are providing. More likely, you are giving an empty password.
 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic