cant connect to mysql through php

Discussion in 'Software' started by help, Dec 27, 2005.

  1. help

    help Corporal

    I set up up apache, mysql ,php, Im able to start all the servics and now ive started to learn php/mysql, but I cant connect to mysql or setup databases within php scripts.

    for example when I run:

    <?php

    $connect = mysql_connect("localhost", "root", "my_pass") or
    die ("check your server connection.");

    ?>

    or try to setup a database, all i get is an empty document, obviously my pass and username is correct, I can run any other php script but when I run mysql commands or querys it doesnt work?
     
  2. Kodo

    Kodo SNATCHSQUATCH

    I haven't messed with mysql in ages but I don't think you can use root as a login from script. Try making another user.
     
  3. Wookie

    Wookie Sergeant Major

  4. help

    help Corporal

    ok thnks guys
     

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