Fedora This forum is for the discussion of the Fedora Project. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-05-2005, 11:06 AM
|
#1
|
Member
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507
Rep:
|
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?
|
|
|
03-05-2005, 11:11 AM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
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?
|
|
|
03-05-2005, 11:16 AM
|
#3
|
Member
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507
Original Poster
Rep:
|
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.
|
|
|
03-05-2005, 11:18 AM
|
#4
|
Member
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507
Original Poster
Rep:
|
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.
|
|
|
03-05-2005, 11:33 AM
|
#5
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
If it is on the same server then you will need to allow connections from localhost as well.
|
|
|
03-05-2005, 12:13 PM
|
#6
|
Member
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507
Original Poster
Rep:
|
Still no luck unless I am entering in the commands wrong.
|
|
|
03-05-2005, 06:32 PM
|
#7
|
Member
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507
Original Poster
Rep:
|
Crap...now I can't even log in on the linux machine. Tells me chris or root is denied from localhost.
|
|
|
03-06-2005, 08:58 AM
|
#8
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Can you post the exact error message you get if you try to login on the command line.
|
|
|
03-06-2005, 02:34 PM
|
#9
|
Member
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507
Original Poster
Rep:
|
ERROR 1045: Access denied for user 'root@localhost' (Using password: NO)
|
|
|
03-06-2005, 02:37 PM
|
#10
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Did you not set a password for the mysql root user?
|
|
|
03-06-2005, 02:41 PM
|
#11
|
Member
Registered: Jun 2004
Location: KY
Distribution: Debian, Mint, Puppy
Posts: 507
Original Poster
Rep:
|
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.
|
|
|
03-06-2005, 02:44 PM
|
#12
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
No. The user databases are completely seperate.
|
|
|
All times are GMT -5. The time now is 12:25 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|