Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache with mysql and php support
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
spyder
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 121

PostPosted: Fri Nov 15, 2002 3:14 pm    Post subject: apache with mysql and php support Reply with quote

alright, if i install the packges for mysql, apache, and php support?

what else do i have to do to get the interaction between them to work??

do i need to emerge any other packages?
Back to top
View user's profile Send private message
Ethernal
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 106
Location: Stockholm, Sweden

PostPosted: Fri Nov 15, 2002 3:15 pm    Post subject: Reply with quote

I'm not sure, but I think you need mod_php and mod_sql as well, anyone who can confirm/deny this ?
_________________
Hmm.. Of course, these are MY opinions - likely to be just as flawed as anyone else's. Um, really, I guess you should assume everyone's speaking out of some external influence. Believe in whatever makes sense to you.
Back to top
View user's profile Send private message
Mat_le_ouf
Apprentice
Apprentice


Joined: 13 Sep 2002
Posts: 257
Location: France

PostPosted: Fri Nov 15, 2002 4:00 pm    Post subject: Reply with quote

To run pache with PHP4 support, just edit the /etc/conf.d/apache file and uncomment the following line :
Code:
APACHE_OPTS="-D PHP4"

And run apache with :
Code:
runscript /etc/init.d/apache start

I think that the link to be done with MySQL is between PHP and MySQL, apache has nothing to do in it...
Look in /etc/apache/conf/php.ini for PHP with MySQL.
Back to top
View user's profile Send private message
spyder
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 121

PostPosted: Fri Nov 15, 2002 4:04 pm    Post subject: Reply with quote

root@spyder spyder # mysqladmin -u root password 'blargblarg'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'

when i try to change the root password
Back to top
View user's profile Send private message
Mat_le_ouf
Apprentice
Apprentice


Joined: 13 Sep 2002
Posts: 257
Location: France

PostPosted: Fri Nov 15, 2002 4:11 pm    Post subject: Reply with quote

Hmm, i'm not an expert in MySQL, I think someone else should be better to solve this problem...
However, is PHP working?
Back to top
View user's profile Send private message
spyder
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 121

PostPosted: Fri Nov 15, 2002 4:19 pm    Post subject: Reply with quote

ya it is... :/
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Fri Nov 15, 2002 7:11 pm    Post subject: Reply with quote

spyder wrote:
root@spyder spyder # mysqladmin -u root password 'blargblarg'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'

when i try to change the root password

Probably a silly question, but is the server running? "/etc/init.d/mysql start" if not.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
fyerk
Apprentice
Apprentice


Joined: 17 Sep 2002
Posts: 212
Location: Atlanta, GA

PostPosted: Fri Nov 15, 2002 8:28 pm    Post subject: Reply with quote

spyder wrote:
root@spyder spyder # mysqladmin -u root password 'blargblarg'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'

when i try to change the root password


Are you trying to change the root password or set the root password (for the first time) ?
_________________
-David
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Fri Nov 15, 2002 8:48 pm    Post subject: Reply with quote

Ethernal wrote:
I'm not sure, but I think you need mod_php and mod_sql as well, anyone who can confirm/deny this ?


You don't need mod_sql, but you want mod_php, not php. Make sure you have "mysql" in your USE flags. Then run these commands:

Code:
emerge apache mod_php mysql
/usr/bin/mysql_install_db
ebuild /var/db/pkg/dev-php/mod_php-4.2.2-r1/mod_php-4.2.2-r1.ebuild config
vi /etc/conf.d/apache (uncomment the line with "PHP4")
rc-update add apache default
rc-update add mysql default
/etc/init.d/mysql start
/etc/init.d/apache start


That should set you up. I just did this morning. I'm surprised there isn't a "Tips 'n Tricks" on this already. If not I'll write one up.
Back to top
View user's profile Send private message
darktux
Veteran
Veteran


Joined: 16 Nov 2002
Posts: 1086
Location: Coimbra, Portugal

PostPosted: Sat Nov 16, 2002 5:10 pm    Post subject: Reply with quote

The correct thing to do to connect to the MySQL daemon, would be
Code:
mysql -uroot -p
and then type in your password. If you have not yet set your password, then you should be able to log in just by typing mysql -uroot

Last edited by darktux on Sat Nov 16, 2002 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
slais-sysweb
Apprentice
Apprentice


Joined: 14 Jun 2002
Posts: 221
Location: London

PostPosted: Sat Nov 16, 2002 8:22 pm    Post subject: Reply with quote

spyder wrote:
root@spyder spyder # mysqladmin -u root password 'blargblarg'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'

when i try to change the root password


I had this problem yesterday it was cured by ensuring that /etc/hosts had an entry for the server that matched the name setup in /etc/hostname.
Code:
127.0.0.1    localhost    yourserver.domain

may also work, but I seem to remember a note somewhere about this causing a problem with something so i suggest
/etc/hostname
Code:
server.domain

and
/etc/hosts
Code:
127.0.0.1    localhost
xxx.x.x.x    server.domain   

_________________
--
djc
sysweb SLAIS UCL
Back to top
View user's profile Send private message
spyder
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 121

PostPosted: Sun Nov 17, 2002 4:31 am    Post subject: thanks Reply with quote

thanks everyone..especially rizzo...i am trying that now..i'll let you know how it turns out..
Back to top
View user's profile Send private message
spyder
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 121

PostPosted: Sun Nov 17, 2002 4:53 am    Post subject: Reply with quote

root@spyder mp3sb_serv # mysql -u root -p < MySQL_create_Table.sql
Enter password:
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


whats that mean??
Back to top
View user's profile Send private message
lapu
n00b
n00b


Joined: 28 Aug 2002
Posts: 15

PostPosted: Sun Nov 17, 2002 12:56 pm    Post subject: Reply with quote

spyder wrote:
root@spyder mp3sb_serv # mysql -u root -p < MySQL_create_Table.sql
Enter password:
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
whats that mean??


Again a silly question, is server running
/etc/init.d/mysqld start
Back to top
View user's profile Send private message
spyder
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 121

PostPosted: Sun Nov 17, 2002 1:11 pm    Post subject: ya Reply with quote

ya it has...

root@spyder spyder # /etc/init.d/mysql start
* WARNING: "mysql" has already been started.

root@spyder spyder # mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
Back to top
View user's profile Send private message
lapu
n00b
n00b


Joined: 28 Aug 2002
Posts: 15

PostPosted: Sun Nov 17, 2002 1:25 pm    Post subject: Re: ya Reply with quote

spyder wrote:
ya it has...

root@spyder spyder # /etc/init.d/mysql start
* WARNING: "mysql" has already been started.

root@spyder spyder # mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)


Do you have /var/run/mysqld/mysqld.sock
Back to top
View user's profile Send private message
spyder
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 121

PostPosted: Sun Nov 17, 2002 1:27 pm    Post subject: Reply with quote

ya it's there

spyder@spyder spyder $ ls -la /var/run/mysqld/
total 8
drwxr-xr-x 2 mysql mysql 4096 Nov 17 03:01 .
drwxr-xr-x 4 root root 4096 Nov 17 03:07 ..
srwxrwxrwx 1 mysql mysql 0 Nov 17 03:01 mysqld.sock
Back to top
View user's profile Send private message
oblique effect
n00b
n00b


Joined: 14 Nov 2002
Posts: 4

PostPosted: Sun Nov 17, 2002 4:07 pm    Post subject: http://www.linuxnewbie.org/forum/forumdisplay.php?s=06fd8480 Reply with quote

First off, I noticed that you haven't tried doing just 'mysql -u root'. I know that the first time you startup mysql and login to it there is no root password set. maybe try issueing 'mysqladmin -u root -password 'newpasswd'. There is more help and better answers in other places, like www.linuxnewbie.org

Hope that leads you the right direction.


oblique
Back to top
View user's profile Send private message
spyder
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 121

PostPosted: Sun Nov 17, 2002 4:10 pm    Post subject: Reply with quote

spyder@spyder spyder $ mysql -u root
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sun Nov 17, 2002 7:53 pm    Post subject: Reply with quote

Do you have Unix domain socket support in your kernel?
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
spyder
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 121

PostPosted: Sun Nov 17, 2002 9:24 pm    Post subject: Reply with quote

ya i do
Back to top
View user's profile Send private message
spyder
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 121

PostPosted: Mon Nov 18, 2002 1:51 am    Post subject: Reply with quote

please help me figure this out
Back to top
View user's profile Send private message
lapu
n00b
n00b


Joined: 28 Aug 2002
Posts: 15

PostPosted: Mon Nov 18, 2002 10:55 am    Post subject: Reply with quote

Have you installed strace.
What says #strace mysql
.....
connect(3, {sin_family=AF_UNIX, path="/var/run/mysqld/mysqld.sock"}, 110) = -1 ENOENT (No such file or directory)
.....
or
....
connect(3, {sin_family=AF_UNIX, path="/var/run/mysqld/mysqld.sock"}, 110) = 0
...
Back to top
View user's profile Send private message
spyder
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 121

PostPosted: Mon Nov 18, 2002 4:44 pm    Post subject: Reply with quote

connect(3, {sin_family=AF_UNIX, path="/tmp/mysqld.sock"}, 110) = -1 ECONNREFUSED (Connection refused)
Back to top
View user's profile Send private message
spyder
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 121

PostPosted: Mon Nov 18, 2002 4:46 pm    Post subject: Reply with quote

i tried changing it back to the original place andi got this

connect(3, {sin_family=AF_UNIX, path="/var/run/mysqld/mysqld.sock"}, 110) = -1 ENOENT (No such file or directory)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum