How to configure Mysql server

Discussion in 'PHP' started by Susanz81, Apr 22, 2007.

  1. #1
    Dear all, I am using easyphp. It is showing mysql server was started. But, How can I connect or configure this server?
     
    Susanz81, Apr 22, 2007 IP
  2. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #2
    Right click on the icon in the sidebar --> configuration --> mysql .
     
    commandos, Apr 22, 2007 IP
  3. Susanz81

    Susanz81 Peon

    Messages:
    23
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It opens just a notepad. But the following program not executing.

    Program:

    <?php
    $con = mysql_connect();
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
    ?>
     
    Susanz81, Apr 22, 2007 IP
  4. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #4
    you need to put a user name , password , connection

    exactly like any web application
     
    commandos, Apr 23, 2007 IP
    Bender likes this.
  5. TechEvangelist

    TechEvangelist Guest

    Messages:
    919
    Likes Received:
    140
    Best Answers:
    0
    Trophy Points:
    133
    #5
    Unless you already have a database application installed, you will need to set up a user and a database before you can connect. Without that, you have nothing to connect to.

    You need to read some articles about working with MySQL. Commandos is right. You are not using a valid MySQL connection.

    You first need to connect a user, then you need to select a database. You can do both with the following line of code:
    mysql_select_db('$database', mysql_connect('localhost','$username','$password')) or die(mysql_error() );
    }
    Code (markup):
    Just substitute the proper values for the variables.
     
    TechEvangelist, Apr 23, 2007 IP