setting database pw

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pk_pk

    setting database pw

    hi,

    i've searched quite a bit, but cant find any post relating to sql
    command for setting database passwords. anyone know how? thanks

    pk

  • Markus Popp

    #2
    Re: setting database pw

    You can only set passwords for user accounts, not for specific databases:

    set password for user@host = password('your_ password');

    Find more detailed information here:


    Markus


    Comment

    • pk_pk

      #3
      Re: setting database pw

      thanks for the reply markus.

      i was under the same impression, but i set up a wiki on my server and i
      noticed that the mysql_connect command the wiki uses doesn't
      authenticate with my mysql server password.

      when i initally set up the wiki, it asked me to create a pw for the
      wiki DB. this pw was not my mysql user pw.

      how is it still able to query the wiki db (without my mysql user pw)
      then?

      i also wrote my own php script and provided the wiki DB pw to the
      mysql_connect command. the connection surprisingly also worked.

      // case A:
      $link = mysql_connect(' localhost', 'mysql_user', 'wikiDB_passwor d');
      mssql_select_db ('[wikiDB]', $link); // success

      // case B:
      $link = mysql_connect(' localhost', 'mysql_user', 'wikiDB_passwor d');
      mssql_select_db ('[anotherDB]', $link); // fails as expected - didnt
      create pw for this DB

      i shutdown my wiki and restarted it before trying the above too. how is
      this possible? case B makes me think you can set DB specific pw...?

      thanks in advance,

      pk

      Comment

      • Mike A.

        #4
        Re: setting database pw

        On Thu, 24 Nov 2005 14:20:47 -0800, pk_pk wrote:
        [color=blue]
        >...case B makes me think you can set DB specific pw...?
        >[/color]

        Part of the user permissions is which databases can be accessed, and in
        what capacity (read-only, update, drop, etc.)




        Mike A.
        MySQL 5.0.15 on FreeBSD 5.4

        Comment

        • pk_pk

          #5
          Re: setting database pw

          thanks markus and mike =) i looked more carefully into the link markus
          pasted, and there is mention of "user permissions is which databases
          can be accessed" with the "GRANTS" command.


          kani

          Comment

          Working...