#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    28
    Rep Power
    0
    I established a user 'root' and a p.w. for MySQL real early during installation (possibly a confussion of mine).

    Using that p.w., I can log into MySQL and work with the "mysql>" prompt.

    But when I invoke, as LINUX root-user, at a terminal's LINUX prompt:

    "mysqladmin version", the response is:

    "Access denied for user: 'root@localhost' (Using password: NO)'

    The password I gave to "root" of MySQL is different from the LINUX root password.

    I understand that 'root' of LINUX and passwords are completely different things from users and passwords of MySQL.

    How do we communicate with MySQL, from the LINUX prompt, (who we are) and (our MySQL password), so as to access the "mysqladmin" program??

    Thanks for helping.
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    You have to specify the password whenever you connect.

    mysqladmin version -u root -ppassword
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    28
    Rep Power
    0
    Thankyou, rod k, your answer was good.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    28
    Rep Power
    0
    In the above circumstances, I have to provide user and p.w. data for every access from the Linux prompt, and that works fine.

    However, is there a way to "connect" and "remain connected" to the database from the Linux prompt?

    Also, in a brief way, how would an application running under Linux remain connected, so it queries, modifies, etc., without passwording on each access?

    Thanks for answering.

  8. #5
  9. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    61
    To connect to mysql normally, you would use 'mysql', not 'mysqladmin'.

    mysql -u root -p

    or mysql -u root -h [hostname] -p

    would prompt for the root password, and then you will have a mysql> prompt, which you can keep open as long as you like, and close when done with 'quit'.

    For an application running under Linux to connect to MySQL depends on what exactly you mean by that. Are you developing this application? Then you need to learn the MySLQ API. If you mean a previously developed client application, that depends on how that application was created. Basically, however, if your software tool can hold the username and password as a configuration, then you could start it up without specifying username and password every time.

    In PHP, I use one include file to specify username, hostname, and password, and all other places I access the database, I just refer to that file.

Similar Threads

  1. tranfer tables from mysql to postgresql in linux
    By muthayalap in forum Java Help
    Replies: 0
    Last Post: February 3rd, 2004, 10:13 AM
  2. problem starting up mysql in linux
    By robin01 in forum MySQL Help
    Replies: 4
    Last Post: October 14th, 2003, 06:50 PM
  3. How to make mysql in linux is not case senitive?
    By pennytsang in forum MySQL Help
    Replies: 0
    Last Post: August 31st, 2003, 10:07 PM
  4. Errcode:13 . How to solve it on MySQL + Windows 2000
    By hankycheng in forum MySQL Help
    Replies: 28
    Last Post: August 3rd, 2003, 10:05 AM
  5. linux mySQL help
    By axolotlpacman in forum MySQL Help
    Replies: 0
    Last Post: February 17th, 2003, 10:38 PM

IMN logo majestic logo threadwatch logo seochat tools logo