MySQL/php problem
I've been having a rather weird problem. I set up my Linux box as sort of a home web/mysql server so I can work on some of my school projects at home. Here's my problem:
I set up a database (chris) that I have full access to. I can connect to the chris database from my Windows computer using MySQL Control Center without a problem. I set up a php file so I can also access the database but everytime the php script executes it tells me it failed to connect. And I am quite sure everything is entered in correctly in the php script. Any ideas? |
What error do you get from "mysql_error()"?
What grant statement did you use to give the user you are connecting as access to the database? |
Well before the error was just a hard coded if/else that indicated if the connection was successful. It would always say it didn't connect. I took that part of the statement out and it appears to execute...odd.
I used a grant all privelges to the chris database from our subnet (192.168.0.%) identified by the password. Not the most secure but it worked for me before. |
Just checked my webpage which uses the php/mysql....pages render fine but they don't pull what they need from the database. They don't pull anything actually.
|
If it is on the same server then you will need to allow connections from localhost as well.
|
Still no luck unless I am entering in the commands wrong.
|
Crap...now I can't even log in on the linux machine. Tells me chris or root is denied from localhost.
|
Can you post the exact error message you get if you try to login on the command line.
|
ERROR 1045: Access denied for user 'root@localhost' (Using password: NO)
|
Did you not set a password for the mysql root user?
|
I thought I did....I happened to stumble across a script while browsing the net last night about it...mysql_setpermission or something like that and did it that way. Of course if I actually use the password option and put it in I can log in....I just thought being logged in as root I could access mysql without having to reenter the password.
EDIT: Basically all I want is to able to do log in through command line on linux either as root or chris (although more chris than anything) and have all acess to the database....both from Linux and my XP machine. |
No. The user databases are completely seperate.
|
All times are GMT -5. The time now is 06:41 PM. |