PHP & mysql

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

    PHP & mysql

    First time I have installed mysql.

    I have not been able to connect to the server/database with a new php
    installation.

    I have installed IIS. Do I need this for mysql?

    The php works fine. I can run scripts,etc.

    When I try mysql_connect ("localhost","m ysql_user", mysql_password" ) or
    die....

    I get cannot connect to Mysql server on localhost(10061 ) ....

    How do I locate the name or define the server name? ??localhost??
    How do I define or locate the username for the server?
    How do I locate the password or define the password?

    Is there a program (control panel) in Windows 2000 Pro that will let me look
    at the server name, info? To make sure the server is functioning properly?

    Look at the database information, such as, database name, tables, etc.
    without connecting through php?

    Thanks for the help.




  • mediamechanix

    #2
    Re: PHP & mysql


    "Ken" <kkrolski@wi.rr .com> wrote in message
    news:RjD1c.3072 7$o01.11093@twi ster.rdc-kc.rr.com...[color=blue]
    > First time I have installed mysql.
    >
    > I have not been able to connect to the server/database with a new php
    > installation.
    >
    > I have installed IIS. Do I need this for mysql?
    >[/color]
    You need a webserver and IIS will work but you will probably be happier
    installing Apache rather than IIS. You can download a WAMP such as
    Apache2Triad from SourceForge and it will automatically install everything
    you need and work fine after a reboot.

    You should install the Windows Administratativ e Tools from your CD in order
    to access the MySQL Service. From there, you can start and restart the MySQL
    server as needed.
    [color=blue]
    > The php works fine. I can run scripts,etc.
    >
    > When I try mysql_connect ("localhost","m ysql_user", mysql_password" ) or
    > die....
    >
    > I get cannot connect to Mysql server on localhost(10061 ) ....
    >[/color]
    It cannot connect to the MySQL database server on port 10061. This probably
    means that the username and password you are using are incorrect. Also, in
    your example above, you are missing a double quote.
    [color=blue]
    > How do I locate the name or define the server name? ??localhost??[/color]

    Localhost is ip adress 127.0.0.1 on your system. I don't believe you can
    change the name. You can however assign a workgroup name to your machine and
    use in instead of or in unison with 'localhost'.
    [color=blue]
    > How do I define or locate the username for the server?
    > How do I locate the password or define the password?
    >[/color]
    The default username for most MySQL installs is root with no password. To
    assign a password to root, open a console window (run command.exe) and
    change directories to the location of MySQL, then enter the following
    commands.

    mysqladmin -u root password <password>
    mysqladmin -u root -h localhost password <password>

    For both commands, replace <password> with whatever password you want to
    assign.

    To simplify things in the furture, you might want to get a copy of DBTools
    Manager Professional (opensource) which mimics the operation of MSSQL
    Manager. You can use it to create databases, view and edit data, create
    users, etc. in a Windows friendly environment.

    phpMyAdmin is a better tool for routine database management, but the above
    comes in handy in many cases.
    [color=blue]
    > Is there a program (control panel) in Windows 2000 Pro that will let me[/color]
    look[color=blue]
    > at the server name, info? To make sure the server is functioning[/color]
    properly?[color=blue]
    >[/color]
    Select the System applet from Control Panel. However, you really need to
    install the Administrative Tools mentioned above, especially if you are
    using IIS.

    Also note that you can use Apache and IIS on the same box, but need to
    assign the two webservers to different ports. IIS installs on port 80. You
    could probably install Apache on port 81.
    [color=blue]
    > Look at the database information, such as, database name, tables, etc.
    > without connecting through php?
    >
    > Thanks for the help.
    >
    >
    >
    >[/color]


    Comment

    Working...