• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

[CentOS 5.5] MySQL stop gives access denied error

 
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am in /etc/init.d directory.



Why first command gives error(even though I am in proper directory) while second command works OK?
 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Saurabh Pillai,

Firstly, I'm not mysql expert, however, below are my guesses:

1) My first guess was, you are using mysql command without password (and you provided password in config file), and that is the reason for 'using password: NO' thing.
2) However, your second command is interesting. It works with full path, but doesn't work with simple command. As of this, my (another) guess is - path defined for mysql in PATH variable is different from actual path (or more than 1 versions of mysql are there etc.).

I hope this helps.
 
Saloon Keeper
Posts: 28709
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Oh this is a good one!

The reason is quite simple.

The first command is invoking the mysql client application program. The root user has not been given mysql access rights to the database named "stop" when accessing from localhost.

The second command works, because it's a shell script that controls the actual mysql server daemon. Except I thought its name was supposed to be "mysqld"
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I missed it...
 
Greenhorn
Posts: 7
Eclipse IDE Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They are totally 2 different commands, the one in init.d is a script (you can proly check by using cat mysql inside init.d folder) and the mysql(anywhere) on the first one is also different(proly the one in /usr/bin you can check by using which command 'which mysql') . I think the one you need is the 2nd one. the first one is the client app.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic