SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cleaning up a previous installation/making the new one work.

    Last year I made some efforts to set up an Apache/php/MySQL server (on W2K), then had to turn my attention to other things. Now I am trying to pick up where I left off, and have forgotten or misplaced various relevant details.

    My immediate aim is to set up a simple contacts database online, and I've managed to verify that the webserver and php are running. But I have some issues with the MySQL installation and am wondering whether I can reconfigure it or just start over somehow.

    To make things worse I tried to upgrade to 4.1.12 over the existing installation, and found that I couldn't run it as a Windows service with the name MySQL. That means I've got some leftover bits somewhere, right? So I am running the service as MySQL41. It seems to be okay that way, but I'm not entirely sure about that (see below), and am lost as to what I should do next.

    Should I be trying to connect to databases? Should I be cleaning up some configuration or registry details? Are there compatability issues that I need to resolve between versions of MySQL and php? Is there some step-by-step procedure I can go through to make sure I've got things set up correctly?

    Here are some specs from the phpinfo page:

    System Windows NT 5.0 build 2195
    PROCESSOR x86 Family 6 Model 4 Stepping 2, AuthenticAMD
    Apache/2.0.50 (Win32) PHP/4.3.8
    MySQL Client API version 3.23.49

  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)
    you need to remove the old mysql service, then add the new one.

    command to remove a mysql service:
    mysqld --remove

    command to install the new service:
    mysqld --install

  3. #3
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay. Thanks for the pointer. I got at least part way there by stopping the existing MySQL41 service, then starting up the Command Prompt and issuing the install instruction:

    C:\mysql>mysqld --remove MySQL41
    Service successfully removed.

    C:\mysql>mysqld --install MySQL --defaults-file="C:\mysql\my.ini"
    Service successfully installed.

    C:\mysql>

    So far, so good. I started the MySQL service using the Services manager.
    But now, when I run a php script, I get this message:

    Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: ***) in C:\***
    Unable to select database

    So I've got a password (or even a username) mixed up somewhere. What do I need to do?

  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)

  5. #5
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool!
    Took care of that, then got a new problem:
    Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\***\contact.php on line 5
    Unable to select database

    So I searched the Reference Manual for info and found A.2.3. Client does not support authentication protocol. This makes me want to upgrade my version of php from 4.3.8 to 5. But before I think about upgrading and any attendant complications, I used one of the use the several 'old password' options.

    * Reset the password to pre-4.1 style for each user
    * use UPDATE and FLUSH PRIVILEGES
    * Tell the server to use the older password hashing algorithm

    The last one seems like the best option, and seems to have done the trick. I don't get the mysql_connect() error any more.

    Two things aren't clear. One, I'm not sure I've actually connected to a database. Two, I issued the --old-password command like this:
    mysql> --old-passwords;
    mysql>

    Is that the correct way to do it?
    Last edited by dglp; Jun 21, 2005 at 20:45.

  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)
    no, that is not how you issue options to mysql. you have to remove the mysql service, then reinstall it and append that option to the mysqld --install command.

    your best bet until you upgrade to PHP 5 is to make sure you use the old password hashing algorithm when you set up new user accounts. as long as you remember to do that, you won't need the --old-passwords option.

    unless your web application is going to be adding and removing users; in that case, you're better off with the --old-passwords option.


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
  •