Jump to content

Mysql Seems To Not Be Talking To Localhost...help


Recommended Posts

Right, I have a problem - I'm in the midst of building a shop site for someone based on php and mysql

I want to build it offline so am using Apache, Mysql and PHP

PHP and Apache are qorking fine,

MySql works fine through the command prompt

but I get NO joy when trying to get MySql to run a .sql from the command prompt if I tell it to look at localhost eg

"mysql -h localhost -u user -D database -p < myfile.sql"

and I can't get mysql to work at all when trying to access it with php through localhost - I mean when I run a php script from localhost eg http://localhost/script.php

As the elements work fine on their own, I can't understand what's going on. have I missed an alteration in a conf or ini file somehwere?

Like I said, through windows comand prompt MySql works fine so long as I make no reference to localhost. I can create users, databases, tables and I can insert data into tables and call said data in a number of exciting and informative ways, but only through command prompt which is close to no use to me when I am trying to build a database driven website

Please someone give me some advice

:blink:

I'd be grateful of any help

Link to comment
Share on other sites


What versions of Apache, PHP and MySQL?

If you want just a quickfix testing solution, check out xampp.

CAUTION: It is not recommended for live usage online, its only for the newcomer to test his pages. Just use it offline, since you should beef up its security before finally putting it in action. Do post back on how it works out!

http://www.apachefriends.org/en/xampp.html

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...