PHP mysql_connect to database

Discussion in 'Software' started by man_im_bored, Aug 20, 2003.

  1. man_im_bored

    man_im_bored Private E-2

    Umm, yeah, whats wrong with this?
    $link = mysql_connect("localhost", "", "")
    or die("Could not connect stupid!: " . mysql_error());

    I don't have a username or password so....?!??!! What do I do?
    Anyone know. I'm testing this on my own computer (obviously).....and it comes up with

    "Warning: mysql_connect(): Can't connect to MySQL server on 'localhost' (10061) in "
     
  2. man_im_bored

    man_im_bored Private E-2

    Forgot to mention, I'm new at php.
     
  3. iamien

    iamien Cptn "Eh!"

    I think you have a user/pass because that looks like valid code. you sure you have PHP running on this machien <ignroe that if you do :p>
     
  4. man_im_bored

    man_im_bored Private E-2

    php.ini stuff is all good, it has

    mysql.default_user =
    mysql.default_host =
    mysql.default_password =

    :S

    So its not that php.ini file
     
  5. man_im_bored

    man_im_bored Private E-2

    No, I definatly have php on my machine
     
  6. Vlad902

    Vlad902 Guest

    Are you sure MySQL itself is running, sounds like it's not since it has nto bind to a port...
     
  7. Vlad902

    Vlad902 Guest

    MySQL is not PHP, MySQL is a Database, PHP is a web programming language...
     
  8. man_im_bored

    man_im_bored Private E-2

    If I have a username/password.... I dunno what it is...:S
     
  9. iamien

    iamien Cptn "Eh!"

    uGG that what i ment :p you couldn't get that error without PHP install :D made myself look liek a retard. anyway yes it sounds like you need to have MySQL running Vlad is as always correct or at least close to it :p
     
  10. Vlad902

    Vlad902 Guest

    No, always correct ;)
     
  11. man_im_bored

    man_im_bored Private E-2

    running just fine (MYSQLSERVER)
     
  12. iamien

    iamien Cptn "Eh!"

    Well you gotten set up an account within in
     
  13. Philipp

    Philipp Administrator Staff Member

    Change it to: mysql_connect("localhost", "root", "")
     
  14. man_im_bored

    man_im_bored Private E-2

    its all good....thanks anyway.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds