LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 03-05-2005, 11:06 AM   #1
Basslord1124
Member
 
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507

Rep: Reputation: 51
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?
 
Old 03-05-2005, 11:11 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
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?
 
Old 03-05-2005, 11:16 AM   #3
Basslord1124
Member
 
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507

Original Poster
Rep: Reputation: 51
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.
 
Old 03-05-2005, 11:18 AM   #4
Basslord1124
Member
 
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507

Original Poster
Rep: Reputation: 51
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.
 
Old 03-05-2005, 11:33 AM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
If it is on the same server then you will need to allow connections from localhost as well.
 
Old 03-05-2005, 12:13 PM   #6
Basslord1124
Member
 
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507

Original Poster
Rep: Reputation: 51
Still no luck unless I am entering in the commands wrong.
 
Old 03-05-2005, 06:32 PM   #7
Basslord1124
Member
 
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507

Original Poster
Rep: Reputation: 51
Crap...now I can't even log in on the linux machine. Tells me chris or root is denied from localhost.
 
Old 03-06-2005, 08:58 AM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Can you post the exact error message you get if you try to login on the command line.
 
Old 03-06-2005, 02:34 PM   #9
Basslord1124
Member
 
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507

Original Poster
Rep: Reputation: 51
ERROR 1045: Access denied for user 'root@localhost' (Using password: NO)
 
Old 03-06-2005, 02:37 PM   #10
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Did you not set a password for the mysql root user?
 
Old 03-06-2005, 02:41 PM   #11
Basslord1124
Member
 
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507

Original Poster
Rep: Reputation: 51
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.

Last edited by Basslord1124; 03-06-2005 at 02:43 PM.
 
Old 03-06-2005, 02:44 PM   #12
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
No. The user databases are completely seperate.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP/MySQL Problem! SpiderIRE Programming 3 10-19-2005 11:24 AM
php-mysql problem need help productive Linux - Software 1 04-28-2005 02:27 PM
Problem with PHP and MySQL eam Programming 2 08-24-2004 02:33 PM
Problem getting PHP to recognize MySQL, Using PHP 4.0 and MySQL 4.0.20 d2army Programming 4 06-27-2004 08:54 PM
problem with mysql and php nshoboul Linux - Software 3 11-07-2003 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 12:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration