LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 04-13-2004, 09:02 PM   #1
Ryand833
Member
 
Registered: Jan 2004
Distribution: Fedora Core 4
Posts: 31

Rep: Reputation: 15
Apache/PHP/MySQL Problems!


Hello, i'm having some problems getting access to my MySQL database on Linux Redhat 9.

I downloaded and compiled/installed all 3 of the latest versions of Apache, PHP, and MySQL, and got them to all start up when linux starts, and this all works ok.

I tried making a phpinfo.php and it works great, i also tried running /usr/local/mysql/bin/.mysql
This works ok, i can go in and i get the mysql prompt so i can issue commands and everything, works great.

But my problem is when i try to access the mysql database from a PHP file. I get the following error message:

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

I've searched at the forums and played around with a few things, some of the ./configure parameters for PHP and for apache, but no luck.
I'm still fairly new to linux. If anyone has any suggestions it would be greatly appreciated. Thank you
 
Old 04-13-2004, 09:37 PM   #2
Ryand833
Member
 
Registered: Jan 2004
Distribution: Fedora Core 4
Posts: 31

Original Poster
Rep: Reputation: 15
Yay i got it to work. For those of you who ever have the same problem, here's how i fixed it.

I copied the my-medium.cnf from the mysql/support-files directory to the /usr/local/mysql/data directory (don't know if that did anything but i did it anyway).

Then i went to my /usr/local/lib/php.ini file, opened it with VI and set the default sock to /tmp/mysql.sock, then restarted apache server and it works great.
 
  


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
mysql-php-apache problems.. khuti2005 Linux - Newbie 4 10-20-2005 03:28 PM
MySql PhP and Apache Virtualhate Linux - Newbie 4 05-17-2004 05:08 AM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 08:59 PM
apache php-mysql configuration problems ugol Linux - Software 1 11-08-2003 09:13 PM
php-nuke with apache php mysql c0c0deuz Linux - Software 0 03-30-2003 06:23 AM


All times are GMT -5. The time now is 09:39 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration