problem creating a database

Discussion in 'MySQL' started by Sir Najeeb, Feb 26, 2012.

  1. #1
    hi
    when i want to create a database using php code it says :
    Access denied for user ''@'localhost' to database 'my_db'
    i am sure that username and password are true
    note that it connect to the server with no problems
    but when i want to create a database in the server it says :
    Access denied for user ''@'localhost' to database 'my_db'

     
    Sir Najeeb, Feb 26, 2012 IP
  2. Sir Najeeb

    Sir Najeeb Member

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    the problem has been solved
     
    Sir Najeeb, Feb 26, 2012 IP
  3. Debustral

    Debustral Greenhorn

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    13
    #3
    can you publish your solution? im just curious, but i think other people can appreciate it.. especialy those, who will experience same problem in the future :cool:
     
    Debustral, Feb 26, 2012 IP
  4. Sir Najeeb

    Sir Najeeb Member

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #4
    ok i will tell u the solution
    first i have 3 variables , no problem here
    the value of var 1 is the mysql server
    the value of var 2 is the username
    the value of var 3 is the password
    no problems here
    so to connect to the database i must use mysql_connect()
    i typed
    mysql_connect("var1,var2,var3");
    here i found the problem
    variables must not typed between ""
    so , i corrected it , the correct syntax is mysql_connect(var1,var2,var3);
    that's the solution :cool:
     
    Sir Najeeb, Feb 27, 2012 IP
  5. GodOfTerror

    GodOfTerror Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    this is an error associated to username or password being invalid.
    try focusing on connecting properly.

    - Sumer Kolcak
     
    GodOfTerror, Mar 11, 2012 IP