MySQL on a Windows 2003 dedicated server

Discussion in 'MySQL' started by Mr.President, Jun 9, 2010.

  1. Mr.President

    Mr.President New Member

    Joined:
    Apr 25, 2010
    Messages:
    51
    Likes Received:
    1
    Trophy Points:
    0
    I bought a dedicated server and installed MySQL
    1. 3306 port is open
    2. Remote administration in allowed

    Now I wanna create a user to access a database in my server
    I created a user like this
    Code:
    mysql> CREATE USER 'temp'@'localhost' IDENTIFIED BY 'some_pass';
    mysql> GRANT SELECT PRIVILEGES ON mydb.* TO 'temp'@'localhost';
    mysql> CREATE USER 'temp'@'%' IDENTIFIED BY 'some_pass';
    mysql> GRANT SELECT PRIVILEGES ON mydb.* TO 'temp'@'%';
    
    now how I am going to access the database remotely ? I wanna extract some
    information using php

    to connect I need details of the server ?
    PHP:
    $hostname = ;
    $user 'temp';
    $pass ='some_pass';
    $db'mydb';

    #connection code....
    I am lil confused here that how my code will access the databse
    without a proper host name ! I tried to give my dedicated server IP
    but no use it din work !?

    can any 1 advice me on how to configure ?
     
  2. Mr.President

    Mr.President New Member

    Joined:
    Apr 25, 2010
    Messages:
    51
    Likes Received:
    1
    Trophy Points:
    0
    sorry I couldn't edit this post
    another question ?

    therer are two IP's in the server
    1. dedicated server IP
    2. client IP

    which 1 I should use ?
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Your host should be the IP address of your PC where MySQL server is installed.

    If you are connecting only through local network your local ip or else your global static IP
     
  4. Mr.President

    Mr.President New Member

    Joined:
    Apr 25, 2010
    Messages:
    51
    Likes Received:
    1
    Trophy Points:
    0
    if I use ipconfig command and get the IP will that IP usefull for me to connect to the mysql server ?
     
  5. Mr.President

    Mr.President New Member

    Joined:
    Apr 25, 2010
    Messages:
    51
    Likes Received:
    1
    Trophy Points:
    0
    also there are too many IP's !! how I am going to find out which IP is global ? any suggestions ?
     

    Attached Files:

  6. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    What is your PC name and you can use the name of your PC as well to connect if you are just connecting in LAN
     
  7. Mr.President

    Mr.President New Member

    Joined:
    Apr 25, 2010
    Messages:
    51
    Likes Received:
    1
    Trophy Points:
    0
    :embarasse its not from LAN i am connecting from another web-host !
     
  8. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Then you need to have a static IP for the machine which your ISP can tell you.
     
  9. Mr.President

    Mr.President New Member

    Joined:
    Apr 25, 2010
    Messages:
    51
    Likes Received:
    1
    Trophy Points:
    0
    thx shaab... I figured out there were two IP's one finishes like this xxx.xxx.xxx.xx2 next xxx.xxx.xxx.xx3

    I tried with the xxx.xxx.xxx.xx2 din work

    but later after seeing the ipconfig I used the second 1 xxx.xxx.xxx.xx3 it worked 4 me

    any way thx for helping ! shab

    BTW some hosting providers give host names like sb.hostingserver.com

    how they map to the db server ? is it a DNS ?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice