mysql_connect failed in apache 5.0.22

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

    mysql_connect failed in apache 5.0.22

    Hello all,

    I am running MYSQL 4.1.17, PHP 4.3.9 under apache 2.0.52 on solaris.
    PHP seems to work fine, except that it can't connect to mysql
    database. I got this error:

    Warning: mysql_connect() : Client does not support authentication
    protocol requested by server; consider upgrading MySQL client


    But MYSQL 4.1.17 is the latest version, and PHP 4.3.9 is the latest 4
    version. Should I try PHP 5.0.2 or downgrade apache?

    Please help.

    Allen Guan
  • Tim Van Wassenhove

    #2
    Re: mysql_connect failed in apache 5.0.22

    In article <883aa369.04112 20836.6f523b83@ posting.google. com>, Allen Guan wrote:[color=blue]
    > Hello all,
    >
    > I am running MYSQL 4.1.17, PHP 4.3.9 under apache 2.0.52 on solaris.
    > PHP seems to work fine, except that it can't connect to mysql
    > database. I got this error:
    >
    > Warning: mysql_connect() : Client does not support authentication
    > protocol requested by server; consider upgrading MySQL client[/color]

    You should use mysqli_connect

    --
    Met vriendelijke groeten,
    Tim Van Wassenhove <http://www.timvw.info>

    Comment

    • Anonymous

      #3
      Re: mysql_connect failed in apache 5.0.22

      Allen Guan wrote:[color=blue]
      >
      > Hello all,
      >
      > I am running MYSQL 4.1.17, PHP 4.3.9 under apache 2.0.52 on solaris.[/color]
      ^^^^^^
      That is the reason for the error.
      [color=blue]
      > Warning: mysql_connect() : Client does not support authentication
      > protocol requested by server; consider upgrading MySQL client[/color]

      MySQL 4.x use a newer authentication, more secure authentication method
      with longer passwords. Since PHP does not yet understand this method a
      connect will always fail with that error message.
      [color=blue]
      > But MYSQL 4.1.17 is the latest version, and PHP 4.3.9 is the latest 4
      > version. Should I try PHP 5.0.2 or downgrade apache?[/color]

      Neither is neccessary. You can tell MySQL to fall back to old style
      authentication until PHP is upgraded to support the new method.

      Shutdown the MySQL server, look for the MySQL config file (It's usually
      called my.ini and can be found in the directory where you installed the
      server. At least that's where I can find it in the Windows version.). In
      the config file look for the "[mysqld]" section and write one line with
      the content "old-passwords" (without the quotes of course) into the
      file. Save the file and restart the server.

      If you followed these instructions to the letter MySQL will now accept
      calls from PHP again.

      Bye!

      Comment

      • Anonymous

        #4
        Re: mysql_connect failed in apache 5.0.22

        Tim Van Wassenhove wrote:[color=blue]
        >
        > In article <883aa369.04112 20836.6f523b83@ posting.google. com>, Allen Guan wrote:[color=green]
        > > Hello all,
        > >
        > > I am running MYSQL 4.1.17, PHP 4.3.9 under apache 2.0.52 on solaris.
        > > PHP seems to work fine, except that it can't connect to mysql
        > > database. I got this error:
        > >
        > > Warning: mysql_connect() : Client does not support authentication
        > > protocol requested by server; consider upgrading MySQL client[/color]
        >
        > You should use mysqli_connect[/color]

        There is no mysqli_connect( ) in PHP4.

        Bye!

        Comment

        • Anonymous

          #5
          Re: mysql_connect failed in apache 5.0.22

          Anonymous wrote:

          Correcting myself:
          [color=blue]
          > MySQL 4.x use a newer authentication, more secure authentication method[/color]

          MySQL 4.1.x uses a newer, more secure authentication method...

          Comment

          • Brion Vibber

            #6
            Re: mysql_connect failed in apache 5.0.22

            Allen Guan wrote:[color=blue]
            > Warning: mysql_connect() : Client does not support authentication
            > protocol requested by server; consider upgrading MySQL client
            >
            > But MYSQL 4.1.17 is the latest version, and PHP 4.3.9 is the latest 4
            > version. Should I try PHP 5.0.2 or downgrade apache?[/color]

            Both PHP 4.3.9 and PHP 5.0.2 will have this problem because you're using
            the old MySQL client libraries.

            Either recompile PHP explicitly using the updated MySQL 4.1 client
            libraries, or fiddle with MySQL to use the old, compatible
            authentication scheme.

            Please see: http://dev.mysql.com/doc/mysql/en/Old_client.html

            -- brion vibber (brion @ pobox.com)

            Comment

            • Allen Guan

              #7
              Re: mysql_connect failed in apache 5.0.22

              Brion Vibber <brion@pobox.co m> wrote in message news:<30f51uF2v vdqhU1@uni-berlin.de>...[color=blue]
              > Allen Guan wrote:[color=green]
              > > Warning: mysql_connect() : Client does not support authentication
              > > protocol requested by server; consider upgrading MySQL client
              > >
              > > But MYSQL 4.1.17 is the latest version, and PHP 4.3.9 is the latest 4
              > > version. Should I try PHP 5.0.2 or downgrade apache?[/color]
              >
              > Both PHP 4.3.9 and PHP 5.0.2 will have this problem because you're using
              > the old MySQL client libraries.
              >
              > Either recompile PHP explicitly using the updated MySQL 4.1 client
              > libraries, or fiddle with MySQL to use the old, compatible
              > authentication scheme.
              >
              > Please see: http://dev.mysql.com/doc/mysql/en/Old_client.html
              >
              > -- brion vibber (brion @ pobox.com)[/color]

              Thanks a bunch. After I use "set password for 'user'@'localho st' =
              OLD_PASSWORD(ne wpwd, it works.

              Allen Guan

              Comment

              Working...