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.
I'm trying to get mysql all happy on a server that will be running php and apache.
Anyway, I know the server is running because is in the process list. Also, when I do this:
# mysqladmin -h 127.0.0.1 --port=3306 version
I get a good response. However, I don't want to have all that junk on EVERY query. Here's what I get when I do it the "normal way:
# mysqladmin version
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!
Well, anyway, I realy don't know what unix sockets really are...
Ummm ... I don't use MySQL (even though
Slack has a package for it), so won't be able
to give you too much info. How did you install
it? Slack-pack or Source? If source, does it
require you to create a specific user for the
daemon? And if it did, have you made the
directory it was saying owned by that user?
I compiled from source, and slack already had the mysql user and group. I can get the database running, so I know it works. I just want the sock file to work properly so that I don't have to modify all my sql based progs.
@sonderblade - I know its running. ps tells me it is running, nmap tells me it is running, and here's a quote of myself telling you that it is running:
Quote:
# mysqladmin -h 127.0.0.1 --port=3306 version
I get a good response.
@tinkster - yes, it is made and owned by the proper user.
root@server:/var/run/mysql# ls -al
total 1
drwxr-xr-x 2 root root 80 Nov 27 22:22 ./
drwxr-xr-x 7 root root 464 Nov 25 20:26 ../
-rwxrwxrwx 1 mysql mysql 0 Nov 27 22:22 mysql.sock*
root@server:/var/run/mysql# mysqladmin version
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!
Also, to prove its running:
Code:
root@server:/var/run/mysql# ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 480 64 ? S Nov25 0:06 init [3]
root 2 0.0 0.0 0 0 ? SW Nov25 0:00 [keventd]
root 3 0.0 0.0 0 0 ? SW Nov25 0:00 [kapmd]
root 4 0.0 0.0 0 0 ? SWN Nov25 0:00 [ksoftirqd_CPU0]
root 5 0.0 0.0 0 0 ? SW Nov25 0:02 [kswapd]
root 6 0.0 0.0 0 0 ? SW Nov25 0:00 [bdflush]
root 7 0.0 0.0 0 0 ? SW Nov25 0:01 [kupdated]
root 9 0.0 0.0 0 0 ? SW Nov25 0:00 [khubd]
root 12 0.0 0.0 0 0 ? SW Nov25 0:00 [kreiserfsd]
rpc 202 0.0 0.4 1512 248 ? S Nov25 0:00 /sbin/rpc.portmap
root 208 0.0 0.5 1424 324 ? S Nov25 0:00 /usr/sbin/syslogd
root 211 0.0 0.3 1360 208 ? S Nov25 0:00 /usr/sbin/klogd -c 3 -x
root 213 0.0 0.3 1396 204 ? S Nov25 0:00 /usr/sbin/inetd
root 216 0.0 0.7 3044 452 ? S Nov25 0:01 /usr/sbin/sshd
lp 224 0.0 0.3 3348 236 ? S Nov25 0:00 lpd Waiting
root 227 0.0 0.6 1484 400 ? S Nov25 0:00 /usr/sbin/crond -l10
daemon 229 0.0 0.4 1488 292 ? S Nov25 0:00 /usr/sbin/atd -b 15 -l 1
root 234 0.0 0.4 1356 276 ? S Nov25 0:00 /usr/sbin/apmd
root 237 0.0 0.5 6148 320 ? S Nov25 0:00 /usr/local/apache/bin/httpd
nobody 239 0.0 1.8 6256 1132 ? S Nov25 0:00 /usr/local/apache/bin/httpd
nobody 240 0.0 1.8 6248 1136 ? S Nov25 0:00 /usr/local/apache/bin/httpd
nobody 241 0.0 4.2 6420 2620 ? S Nov25 0:00 /usr/local/apache/bin/httpd
nobody 242 0.0 2.2 6252 1364 ? S Nov25 0:00 /usr/local/apache/bin/httpd
nobody 243 0.0 3.1 6268 1952 ? S Nov25 0:00 /usr/local/apache/bin/httpd
root 244 0.0 0.4 5048 284 ? S Nov25 0:00 /usr/sbin/smbd -D
root 246 0.0 1.1 3940 688 ? S Nov25 0:00 /usr/sbin/nmbd -D
root 248 0.0 0.6 3892 388 ? S Nov25 0:00 /usr/sbin/nmbd -D
root 249 0.0 0.0 1404 48 ttyS0 S Nov25 0:00 /usr/sbin/gpm -m /dev/mouse -t bare
root 253 0.0 0.3 1356 192 tty1 S Nov25 0:00 /sbin/agetty 38400 tty1 linux
root 254 0.0 0.3 1356 192 tty2 S Nov25 0:00 /sbin/agetty 38400 tty2 linux
root 255 0.0 0.3 1356 192 tty3 S Nov25 0:00 /sbin/agetty 38400 tty3 linux
root 256 0.0 0.3 1356 192 tty4 S Nov25 0:00 /sbin/agetty 38400 tty4 linux
root 257 0.0 0.3 1356 192 tty5 S Nov25 0:00 /sbin/agetty 38400 tty5 linux
root 258 0.0 0.3 1356 192 tty6 S Nov25 0:00 /sbin/agetty 38400 tty6 linux
nobody 285 0.0 3.1 6764 1976 ? S Nov25 0:00 /usr/local/apache/bin/httpd
nobody 290 0.0 4.4 6772 2736 ? S Nov25 0:00 /usr/local/apache/bin/httpd
nobody 337 0.0 4.0 6772 2488 ? S Nov25 0:00 /usr/local/apache/bin/httpd
nobody 344 0.0 1.7 6240 1092 ? S Nov25 0:00 /usr/local/apache/bin/httpd
nobody 345 0.0 1.4 7296 892 ? S Nov25 0:00 /usr/local/apache/bin/httpd
root 1960 0.0 1.9 5660 1236 ? S 22:26 0:00 /usr/sbin/sshd
root 1962 0.0 2.1 2292 1336 pts/1 S 22:27 0:00 -bash
root 2038 0.0 1.6 2048 1016 pts/1 S 22:53 0:00 bash /usr/local/mysql/bin/mysqld_safe
mysql 2055 0.6 19.5 46176 12064 pts/1 S 22:53 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/loc
mysql 2057 0.0 19.5 46176 12064 pts/1 S 22:53 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/loc
mysql 2058 0.0 19.5 46176 12064 pts/1 S 22:53 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/loc
mysql 2059 0.0 19.5 46176 12064 pts/1 S 22:53 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/loc
mysql 2060 0.0 19.5 46176 12064 pts/1 S 22:53 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/loc
mysql 2061 0.0 19.5 46176 12064 pts/1 S 22:53 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/loc
mysql 2062 0.0 19.5 46176 12064 pts/1 S 22:53 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/loc
mysql 2063 0.0 19.5 46176 12064 pts/1 S 22:53 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/loc
mysql 2064 0.0 19.5 46176 12064 pts/1 S 22:53 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/loc
mysql 2065 0.0 19.5 46176 12064 pts/1 S 22:53 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/loc
root 2074 0.0 1.3 2660 812 pts/1 R 22:55 0:00 ps -aux
Last edited by kleptophobiac; 11-27-2003 at 09:58 PM.
I had a similar problem yesterday after I finally got mysql running. The way I fixed it was to kill all mysql processes and then restart mysql. You can try using shutdown first, but shutdown didn't work for me because at some point after mysql started running, the mysql.sock and pid file disappeared.
Also, when you have php and apache installed, you're going to probably need the php-mysql package that lynger mentioned. Otherwise, php will not be able to connect to the server. If you want to check if you actually need to install the package or if it's already in there, create a page that does phpinfo(). Scroll down and search for a table specifically for mysql. If it's not there, you need the package.
Also, here's some code you can use to see if php and mysql can talk to each other.
[code]
<?php
$db = mysql_connect('localhost', 'baen', 'Ir1sgo9d');
if ($db) echo "Connected, everything is fine.";
else echo "Not connected, but php-mysql module correctly installed.";
?>
[code]
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.