473,659 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

new php and mysql stop playing together

Hi,

A bit of a newbie as far as mysql and php adminning I am; I upgraded
php to version 4.4.6, and mysql to 4.1.22, following the instructions
in the "INSTALL" files of each (I also have the same problem on
another server trying the latest mysql 5.0.*). After this, my php
won't connect to mysql, either with mysql_connect() :

Warning: mysql_connect() [function.mysql-connect]: Can't connect to
local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /
var/www/html/test.php on line 4
or with ezMySQL:

(Warning: Error establishing mySQL database connection. Correct user/
password? Correct hostname? Database server running? in /var/www/html/
lib/ez_sql_mysql.ph p on line 84)
I've checked, and /var/lib/mysql/mysql.sock is there, and I can
connect to the server with the "mysql" client program from the shell
just fine, with the same username, pass, server and database name as
I'm using in the code. And all non-database-related php code works
fine, so MySQL and PHP seem to be working OK independently of each
other; I suspect it's just a php setting somewhere. I'd like to get
more detailed information from the connection failure than the above
messages; is that possible? I set "LogLevel debug" in httpd.conf, and
"log-bin" in /etc/my.cnf, and these in /etc/php.ini:

error_reporting = E_ALL
display_errors = Off
display_startup _errors = Off
log_errors = On
log_errors_max_ len = 1024
ignore_repeated _errors = Off
ignore_repeated _source = Off
error_log = /var/log/php.log ;for some reason, it's not writing to
this....
-----
Here is the output of mysql_explain_l og:

install_driver( mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC
contains: [....]) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: ExampleP, Proxy, Sponge.
at bin/mysql_explain_l og line 55
--------
System info:
mysql Ver 14.7 Distrib 4.1.22
PHP Version 4.4.6 (according to phpinfo(), but the "php" binary still
in my path is still 4.3.9)
php configure command: ./configure --with-apxs2=/usr/sbin/apxs --with-
mysql
Apache: 2.0.52 (CentOS)
OS: CentOS release 4.4 (Final)

If phpinfo() output would help, let me know.

Thanks.

--
S

Apr 4 '07 #1
3 1808
drblitzkrieg wrote:
I've checked, and /var/lib/mysql/mysql.sock is there
Permissions on it?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 4 '07 #2
*** dr**********@gm ail.com escribió/wrote (4 Apr 2007 01:43:08 -0700):
Warning: mysql_connect() [function.mysql-connect]: Can't connect to
local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /
var/www/html/test.php on line 4
Error nº 13 stands for "Permission denied".

Check the permissions of "/var/lib/mysql". In my system they look like
this:

drwxr-xr-x 44 mysql mysql 4096 abr 4 10:18 /var/lib/mysql/

Specifically, users not in mysql group should have "access" permission:

chmod o+x /var/lib/mysql/

I hope this helps.

--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Apr 4 '07 #3
Yes, that helped. Though the socket perms were fine, the directory
was:
drwx------ 5 mysql root 1024 Apr 5 09:47 /var/lib/mysql/
I changed it to:
drwxr-xr-x 5 mysql mysql 1024 Apr 5 09:47 /var/lib/mysql/

For the record, after that it complained about "Client does not
support authentication protocol", but that was solved by resetting its
account's password with OLD_PASSWORD('p ass'). Apparently php's mysql
client doesn't know about mysql's new password hashing even as late as
php 4.4.6!

Anyway, works now.

Thanks!
Check the permissions of "/var/lib/mysql". In my system they look like
this:

drwxr-xr-x 44 mysql mysql 4096 abr 4 10:18 /var/lib/mysql/

Specifically, users not in mysql group should have "access" permission:

chmod o+x /var/lib/mysql/

I hope this helps.
Apr 5 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1332
by: Mark Adams | last post by:
I am a relative newbie to MySQL. I had a Postfix+Courier+MySQL mail server running for several months. It took me a week or so to get it up and running in September. Now, I did a clean upgrade to Mandrake 9.2 and am reinstalling everything. MySQL is kicking my ass and I can't seem to get past it to install everything else. I have it installed and I can start the server through Webmin, but the process runs away -- I get a series of...
0
2828
by: Mark Adams | last post by:
I am a relative newbie to MySQL. I had a Postfix+Courier+MySQL mail server running for several months. It took me a week or so to get it up and running in September. Now, I did a clean upgrade to Mandrake 9.2 and am reinstalling everything. This thing is kicking my ass and I can't seem to get past it. I could really use some help if anybody has any. Just for reference, this was my primary source for information on installation and...
0
5837
by: Mark Adams | last post by:
I am a relative newbie to MySQL. I had a Postfix+Courier+MySQL mail server running for several months. It took me a week or so to get it up and running in September. Now, I did a clean upgrade to Mandrake 9.2 and am reinstalling everything. This thing is kicking my ass and I can't seem to get past it. I could really use some help if anybody has any. Just for reference, this was my primary source for information on installation and...
2
2365
by: Paul Bramscher | last post by:
What are the mechanisms to make words like a/an/the in text and varchar character fields ignored when performing SELECT and utilizing ORDER BY in SQL queries? I've done some hunting around into documentation on character sets (but they are geared mainly at character-by-character rules) and saw some reference to string collating and stop words -- but not seen any of this all put together. Thanks for any assistance,
33
5544
by: Joshua D. Drake | last post by:
Hello, I think the below just about says it all: http://www.commandprompt.com/images/mammoth_versus_dolphin_500.jpg Sincerely, Joshua Drake
3
3210
by: genenamg | last post by:
Hi, I am trying to run and configure Apache 2.0, php 5 and mysql on win xp professional - this is the first time I have tried to install and configure all three. I am having difficulty trying to configure them on my computer. Can somebody help me - this is what I have done so far. Installed Apache 2.0, it worked perfectly ( I checked with my browser - http://localhost) till the point where I started to point where I
4
1239
by: Fredrik Melin | last post by:
If you open a form, add a button, double click on the button, you now enter the code for the button click event. If you switch back to the form, and remove the button, it will also remove the "Handles Button1.click" code, function will remain but the handles tag will be removed, is there a way to stop the IDE doing this all together? (I want an error saying Button1 is not found) Ive tried most of the settings I could find, but no...
39
3211
by: windandwaves | last post by:
Hi Folk I have to store up to eight boolean bits of information about an item in my database. e.g. with restaurant drive-through facility yellow windows
110
10553
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst case scenario for MyISAM backend? Also is it possible to not to lose data but get them corrupted?
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.