SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot kosh's Avatar
    Join Date
    Aug 2000
    Location
    USA
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Our admin can create accounts, but I can't get it to work!

    I work with a server admin. He created an account on MySQL and it works just fine. I created another account to access a different database, but it will not work. Can anyone tell me why? I've done "FLUSH PRIVILEGES" about a million times now. Here is the MySQL user table (password field munged a bit to protect the innocent):



    And here is the MySQL db table:



    Does anyone see anything in that? Can anyone suggest other reasons why I might be able to connect with one login string, but not the other? Also, an important note: both accounts work if I telnet in and login to MySQL from the command line. But with PHP, only the "mt_user" account works.

    -Tony
    Attached Images Attached Images
    Outshine - geek blog & free phpBB mods
    Publisher Database - tools & forums for writers
    What Do Women Want? - dating advice for men, from women

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    because mt_user has access to the mt_user database, and webserver has access to the shared_data database.

  3. #3
    SitePoint Zealot kosh's Avatar
    Join Date
    Aug 2000
    Location
    USA
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks longneck, but that's known & deliberate. Here's the code for mt_user:

    Code:
    if ($database = mysql_connect('localhost', 'mt_user', 'password')) {
       	$connected = mysql_select_db('mt_tables', $database);
       }
    And here's the code for the webserver account:

    Code:
    if ($database = mysql_connect('localhost', 'webserver', 'password')) {
        	$connected = mysql_select_db('shared_data', $database);
        }
    I use mysql_select_db, so it should be OK, shouldn't it?

    -Tony
    Outshine - geek blog & free phpBB mods
    Publisher Database - tools & forums for writers
    What Do Women Want? - dating advice for men, from women

  4. #4
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    and what is the error that mysql gives you?

  5. #5
    SitePoint Zealot kosh's Avatar
    Join Date
    Aug 2000
    Location
    USA
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With the "mt_user" account, there is no error. With the "webserver" account, I get this error:
    Not connected : Client does not support authentication protocol requested by server; consider upgrading MySQL client
    Obviously, since I'm using almost identical PHP code for both, the client isn't really at fault. Something is happening with MySQL that causes it to ask more of the webserver account. Or, I'm starting to think that this might be something external to MySQL. Could a firewall be configured to only allow a certain login through? Or...?

    -Tony
    Outshine - geek blog & free phpBB mods
    Publisher Database - tools & forums for writers
    What Do Women Want? - dating advice for men, from women

  6. #6
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    um... if you had posted that error the first time, you could have saved yourself a lot of time.

    the client is actually at fault here. you're probably using mysql 4.1 or mysql 5. what you need to do is reset the password for webserver using this command:
    Code:
    update user
    set password = old_password('xxxxxx')
    where user = 'webserver'
    see http://dev.mysql.com/doc/mysql/en/old-client.html

  7. #7
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    oh, make sure to replace xxxxxx with the password for webserver

  8. #8
    SitePoint Zealot kosh's Avatar
    Join Date
    Aug 2000
    Location
    USA
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thaaaaaaaannnk you.

    That does indeed fix it.

    -Tony
    Outshine - geek blog & free phpBB mods
    Publisher Database - tools & forums for writers
    What Do Women Want? - dating advice for men, from women


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •