Linux - SoftwareThis 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
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.
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.
Originally posted by twsnnva Does /var/lib/mysql/mysql.sock exist?
Yes, it does. Giving you the effect of ls-l /var/lib/mysql/
Code:
$ ls -l /var/lib/mysql/
total 36
drwx------ 2 mysql mysql 4096 Apr 3 18:40 menagerie
drwx------ 2 mysql mysql 4096 Apr 1 22:27 mydata
drwx------ 2 mysql mysql 4096 Mar 26 23:12 mysql
srwxrwxrwx 1 mysql mysql 0 Apr 15 08:24 mysql.sock
drwx------ 2 mysql mysql 4096 Mar 26 23:12 test
Have you compiled your PHP wright?
Look where you have your mysql.sock
Code:
$ mysql -h host_name -u user_name -p
Enter password:
mysql> status
--------------
...
UNIX socket: /tmp/mysql.sock
...
--------------
No, I have not compiled PHP as I am using the packaged version of PHP which comes with Fedora Core 3. I just installed it.
The mysql.sock exists in /var/lib/mysql/
Checked this status, and the result is...
Code:
mysql> status
--------------
mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)
Connection id: 3
Current database:
Current user: anindya@localhost
Current pager: stdout
Using outfile: ''
Server version: 3.23.58
Protocol version: 10
Connection: Localhost via UNIX socket
Client characterset: latin1
Server characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 17 min 8 sec
Threads: 1 Questions: 4 Slow queries: 0 Opens: 6 Flush tables: 1 Open tables: 0 Queries per second avg: 0.004
--------------
Friend, I am a beginner in this trade, even on Linux. You wrote './configure ...', what is these three dots? Should I provide the command as usual with these three dots? I have checked that mysql.sock exists in /var/lib/mysql/, so please take a little bit pain to send me the exact command which I have to use.
Quote:
If it doesn't work, create a php file with this code
PHP Code:
<?php
phpinfo();
?>
Start it in the browser and look if MySQL is enabled.
Hope this helped!
Boby
Yes, I have created a page using phpinfo; and it tells that MySQL is enabled. The output of MySQL part is...
Code:
mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.58
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient
Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off
Ok, you shouldn't need that symlink as the socket is already in the right place, and works for your mysql client program, just not PHP.
The socket worked for the client app but not PHP, and the tcp/ip connection worked for PHP but was told by MySQL that the user was not permitted from that hostname.
So you seem to have a problem with PHP for the socket, and maybe MySQL for the 127.0.0.1 route.
Have all apps been installed from precompiled official .rpm files? Are there any updates for FC3 regards these apps?
Originally posted by Proud Ok, you shouldn't need that symlink as the socket is already in the right place, and works for your mysql client program, just not PHP.
The socket worked for the client app but not PHP, and the tcp/ip connection worked for PHP but was told by MySQL that the user was not permitted from that hostname.
So you seem to have a problem with PHP for the socket, and maybe MySQL for the 127.0.0.1 route.
Have all apps been installed from precompiled official .rpm files? Are there any updates for FC3 regards these apps?
I have updated apache before a couple of months. At that time I did not find any problem and no error message.
$link = mysql_connect('127.0.0.1', 'user_name', 'password')
or die('ERROR in connection : ' . mysql_error());
I am getting the error message, but if I access mysql as the default user I am being passed and there is no error. Thus, if I write the above line as follows :
Code:
$link = mysql_connect('127.0.0.1','','')
or die('ERROR in connection : ' . mysql_error());
I am not getting any error, and I can get access to the databases that comes with the mysql.
Still I get error if I want to connect the databases which I have created with my own 'user_name' and 'password'.
What is the problem? Why I cannot connect with my 'user_name' and 'password'? It is to be mentioned that my 'user_name' and 'password' is already granted for all privileges.
Please help
Anindyanuri
Last edited by anindyanuri; 04-16-2005 at 08:46 AM.
Case - I
I am giving the output of 'netstat -anl' command while I am connected to mysql as user 'anindya' and host 'localhost': Porto RefCnt Flags Type State I-Node Path
Unix 2 [ACC] STREAM LISTENING 8016 /var/lib/mysql/mysql.sock
Unix 3 [ ] STREAM CONNECTED 14886 /var/lib/mysql/mysql.sock
Case - II
This is the output of the 'netstat -anl' command whicle I am connected to mysql as admin Porto RefCnt Flags Type State I-Node Path
Unix 2 [ACC] STREAM LISTENING 8016 /var/lib/mysql/mysql.sock
Unix 3 [ ] STREAM CONNECTED 26733 /var/lib/mysql/mysql.sock
In second case I can able to connect to mysql from PHP but in Case-I, myself fails to connect to mysql from php.
What to do?
Regards
Last edited by anindyanuri; 04-22-2005 at 11:16 AM.
Read those articles. The problem is exactly same which I am facing. Thank you Masand for your pin-point accuracy. I shall now try for the solutions, hope it will work. I'll inform what happens for me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.