LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-16-2000, 02:22 PM   #1
Dominic
LQ Newbie
 
Registered: Dec 2000
Location: Somerset, UK
Distribution: Mandrake
Posts: 6

Rep: Reputation: 0
Angry


Oh Poo!
I'm struggling with trying to get MySQL support with PHP.

I haven't got a clue if I installed apache when I installed Linux or not, but it is there and I can get php to work. I don't know if I installed php later or not and if I did, if it was a binary, source or RPM - or how to find out!

Anyway, I have mySQL installed from source and can use it from the command line. I have some php with mySQL stuff that works on my ISP machine successfully.

How oh how do I add mySQL support to my machine?

I've just had a go at following the DevShed tutorial for this http://www.devshed.com/Server_Side/A...ation/Database and basically gone through their course of action to re-install apache and that starts ok. Then they say to install php, so I've tried this with version php-4.0.3pl1.tar gotton from http://uk.php.net. I untarred the file, then ran the following (as suggested):-
./configure --with-apxs=/usr/local/apache/bin/apxs \
--with-config-file-path=/etc/httpd \
--with-mysql \
--with-system-regex

The configure script craps out, with this message:-
checking for flex... no
checking for lex... no
checking for yywrap in -ll... no
checking lex output file root... ./configure: lex: command not found
configure: error: cannot find output from lex; giving up

...cheers configure!!

Now, php doesn't work at all. The apache re-install has buggered things too. If I try to use the old httpd.conf file, bits don't work. With the new one, I can only get the basic connection to the server to work i.e. no further than http://linuxsvr/

Where the f**@s lex? How do I get that? Should it be part of the kernel or do I have to add it somehow? Windoze may be crap, but installing sure is simple isn't it!

Pigs Bums! Any ideas, or do I just swear a lot and give up and go back to DOS?

Linux version is 2.2.15-4mdksecure
Apache version 1.3.12
mySQL version 9.38 Distrib 3.22.32 for pc-linux-gnu
php version php-4.0.3pl1.tar from http://uk.php.net.


 
Old 12-17-2000, 01:30 PM   #2
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,600

Rep: Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083
You need to install the flex RPM. If you still have problems after that let us know.
 
Old 12-17-2000, 02:11 PM   #3
Dominic
LQ Newbie
 
Registered: Dec 2000
Location: Somerset, UK
Distribution: Mandrake
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks Jeremy,

I percy-vered and eventually installed apache again and then php3 again with mySQL support (had to give up on php4 though, with the lex problem - maybe another day!). After many expletives and kicking the cat, the dog, the guinea pigs, the kids and the wife, I managed to update the new httpd.conf from the old one with bits and pieces and got php running again (hoorah with big brass knobs on).

It appears to have mySQL support, as I now get a mySQL error from mysql_connect()(a step forward anyway?). I also get an error connecting to mySQL from the command line, but that's another story. It's the old...

ERROR 1045: Access denied for user: 'bdec_ronf@linuxsvr' (Using password: YES) - using 192.168.1.1 and localhost fail also.

I think I had this first time I tried mySQL and got round it somehow? Can't remember now? I can connect as user root like .... mysql -u root -p bdec_ronf, with no problem?

Any obvious things to test?

Dominic the not so great.
 
Old 12-17-2000, 02:46 PM   #4
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,600

Rep: Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083Reputation: 4083
Did you setup a user bdec_ronf? Don't forget that you have the flush privileges after changing the grant table.
 
Old 12-17-2000, 04:14 PM   #5
Dominic
LQ Newbie
 
Registered: Dec 2000
Location: Somerset, UK
Distribution: Mandrake
Posts: 6

Original Poster
Rep: Reputation: 0
I have added 2 records in table host; one with host 'linuxsvr' and one with host 'localhost'. Both records have Db = 'bdec_ronf' and all privileges set to 'Y'.

I've now added three DB records; one with host = 'linuxsvr' one with host = 'localhost' and one with host = '%'. All have Db = 'bdec_ronf' and user = 'bdec_ronf'. 'localhost' & 'linuxsvr' have Select, Insert, Update, Delete, Create & Drop privileges are 'Y' - others = 'N'. '%' host has all privileges = 'Y'.

I have 2 user records; one with Host = 'localhost', one with "%". Both have user = 'bdec_ronf' and ALL privileges = 'Y' now!

I've tried "flush privileges" in mysql, also, "mysqladmin reload" from the command line. I've even stopped and restarted the mysql daemon. Strangely, if I type "ps -eaf | grep sql", logged in as root, I see the processes; but type it, logged in as me and I see no such processes????

If I use root in my php or on the command line, all is well.

Your task, Jeremy (if you decide to take it), is to get my system running! This posting will self-destruct in 10 seconds........

Dominic
 
Old 12-19-2000, 04:23 AM   #6
Dominic
LQ Newbie
 
Registered: Dec 2000
Location: Somerset, UK
Distribution: Mandrake
Posts: 6

Original Poster
Rep: Reputation: 0
Thumbs up Got it!

Logged in to mySQL as root on the mysql Database. Removed all rows from HOST table. Removed all rows from the DB table, except the two initial rows for DB test.

Issued "Grant all on bdec_ronf.* to bdec_ronf@localhost identified as 'mypassword'" command, which adds a row to the DB table. "flush privileges" and hey presto! I can now access the DB from the command line and PHP as bdec_ronf.

Phew! Now all I need to do is get the flex RPM and have another go at installing PHP4!! Next year maybe?

Cheers Jeremy for your help anyway.

Dominic.
 
  


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
apache + php + openldap = my big frustration :( toudi Slackware 3 07-19-2005 11:53 AM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 08:59 PM
Apache+Mysql+php c0c0deuz Linux - Software 0 08-14-2003 02:14 PM
php-nuke with apache php mysql c0c0deuz Linux - Software 0 03-30-2003 06:23 AM
apache mysql and php nakkaya Linux - Software 2 03-26-2003 03:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:04 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