Re: The Mysql socket thing using Redhat 7.1
jason bailey ([EMAIL PROTECTED]) writes: I'm consistently getting the error (2002) : Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (111) You mean /var/lib/mysql/mysql.sock? Details are IMPORANT. I've deleted it and running something above has brought it back again!- this is good I think Bad idea. 1. Can i found out if the server is or is not running -which command and what am I looking for? mysqladmin status 2. Can I stop the mysql server mysqladmin shutdown 3. Can I start it? safe_mysqld Where is mysql.sock? In /tmp? If so: ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock Should get you going. -- Ed Carp, N7EKG - [EMAIL PROTECTED] - 214/341-4420 - http://www.pobox.com/~erc Squished Mosquito, Inc. Internet Applications Development Escapade Server-Side Scripting Language Development Team http://www.squishedmosquito.com Pensacola - Dallas - Dresden - London - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: The Mysql socket thing using Redhat 7.1
Ed, Thanks for the email. I was a bit tired last night and was a little frustrated (4 nights getting nowhere), so apologies if I was little rude (I've just reread my email) and sarcastic, but thanks for the 'Details' pun. I've dug myself into a hole offering to set up a Linux/Apache Webserver for a friend. There's no rush but wanted to use it as a learning experience and am getting problems with mysql- everything else seems ok. jason bailey ([EMAIL PROTECTED]) writes: I'm consistently getting the error (2002) : Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (111) You mean /var/lib/mysql/mysql.sock? Details are IMPORANT. Yes, thanks for the pun. It was the above /var/lib/mysql/mysql.sock and I noted that deleting it and then running mysql_install_db or possible safe_mysqld recreated. I've deleted it and running something above has brought it back again!- this is good I think Bad idea. Slightly sarcastic- sorry 1. Can i found out if the server is or is not running -which command and what am I looking for? mysqladmin status As I remember and I'm not sure I was going round in circles- this was a call giving the error- I've just read somewhere to check that this is installed, so will do that tonight 2. Can I stop the mysql server mysqladmin shutdown Again an error on that one 3. Can I start it? safe_mysqld Yep it does produces a lot of information and then ends (I think- you see I'm not sure) Where is mysql.sock? In /tmp? If so: ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock mysql.sock is in the directory that the error produces i.e. /var/lib/mysql/mysql.sock ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock Should get you going. This, in my ignorance, looks like a soft link to the mysql.sock in the /var/lib/mysql/mysql.sock location. The file(?) does exist and I'm not sure why a softlink will help unless it's something to do with permissions. Thanks for your suggestions I'll give them a try. Regards Jason Dr Jason Bailey Desktop Applications Consultant Computing Service The University of Sussex - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: The Mysql socket thing using Redhat 7.1
Jason Bailey ([EMAIL PROTECTED]) writes: You mean /var/lib/mysql/mysql.sock? Details are IMPORANT. Yes, thanks for the pun. It was the above /var/lib/mysql/mysql.sock and I noted that deleting it and then running mysql_install_db or possible safe_mysqld recreated. Well, it wasn't a pun :) Details are critically important, especially when you work with complex systems like these. I was commenting on the lack of detail in your post - you ran something and something happened, but you weren't quite sure what. It's much more difficult when people have to guess what you did. I'm not trying to flame you at all - but you will probably be able to get a lot more, and a lot higher quality, help if you can supply as much detail as possible. I've deleted it and running something above has brought it back again!- this is good I think Bad idea. Slightly sarcastic- sorry No, this really *is* a bad idea! The mysql.sock file is created by the server - if you delete it, you will not be able to connect locally. ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock Should get you going. This, in my ignorance, looks like a soft link to the mysql.sock in the /var/lib/mysql/mysql.sock location. The file(?) does exist and I'm not sure why a softlink will help unless it's something to do with permissions. If the server is creating mysql.sock in /var/lib/mysql and something else is looking for it in /tmp, this is the easiest way to get it to work, besides checking to make sure that the permissions are such that anyone who needs to can read and write to mysql.sock. -- Ed Carp, N7EKG - [EMAIL PROTECTED] - 214/341-4420 - http://www.pobox.com/~erc Squished Mosquito, Inc. Internet Applications Development Escapade Server-Side Scripting Language Development Team http://www.squishedmosquito.com Pensacola - Dallas - Dresden - London - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: The Mysql socket thing using Redhat 7.1
Ed, Once again, thanks for the email response. I'm going to try all the suggestions I've received. A colleague has suggested as I'm new to Linux to select the 'Install Everything' option in red hat 7.1. He suggests that it's probably easier (for me) to get everything installed and work backward (uninstall the unnecessary) as I learn more. If the server is creating mysql.sock in and something else is looking for it in /tmp, this is the easiest way to get it to work, besides checking to make sure that the permissions are such that anyone who needs to can read and write to mysql.sock. -- I think this may be my problem in that I couldn't understand whether mysql.sock should be located in /var/lib/mysql but is required to be in /tmp. It certainly appears in /var/lib/mysql I'll try your suggestion for this and check permissions. Well, it wasn't a pun :) Details are critically important, especially when you work with complex systems like these. I was commenting on the lack of detail in your post - My mistake about the Pun. I do agree details are important; I will use mysqlbug next time, if I get no joy. I'd found several, if not more, postings from several people with the same type of question, regarding the error I was getting. I'd assumed that this common problem was well understood and didn't require explicit detail from myself. you ran something and something happened, but you weren't quite sure what. It's much more difficult when people have to guess what you did. I'm not trying to flame you at all - but you will probably be able to get a lot more, and a lot higher quality, help if you can supply as much detail as possible. I would'nt blame you for flaming my first email was a little rude. The detail I will try for next time. I've deleted it and running something above has brought it back again!- this is good I think Bad idea. Slightly sarcastic- sorry No, this really *is* a bad idea! The mysql.sock file is created by the server - if you delete it, you will not be able to connect locally. I'd been sarcastic and was apologising. I realised it was a bad idea but was getting frustrated and wanted to see if it would be recreated as a test if I was running the server at all. On deleting it I was finding that it was being recreated when running something. Something- I wasn't sure about at the time either mysql_install_db or safe_mysqld - still not sure but will check tonight when I get home. Dr Jason Bailey Desktop Applications Consultant Computing Service The University of Sussex - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: The Mysql socket thing using Redhat 7.1
[EMAIL PROTECTED] (Jason Bailey) writes: If the server is creating mysql.sock in and something else is looking for it in /tmp, this is the easiest way to get it to work, besides checking to make sure that the permissions are such that anyone who needs to can read and write to mysql.sock. -- I think this may be my problem in that I couldn't understand whether mysql.sock should be located in /var/lib/mysql but is required to be in /tmp. It certainly appears in /var/lib/mysql I'll try your suggestion for this and check permissions. As written before, it is a permissions problem - mysql_install_db (unnecesarry , don't run it - just run service mysqld start ) will create files owned by root. If you look in the default /etc/my.cnf, the database runs as user mysql (for security reasons). To fix it, do a chown -R mysql.mysql /var/lib/mysql If you had started mysql the same way you start other services (httpd, samba, etc) via tksysv/ntsysv(permanently, on every boot) or service httpd start (do it right now - equivalent to /etc/init.d/httpd start), it would have created the database with correct permissions automatically. mysql_install_db and safe_mysqld aren't necesarry, and will often cause problems. -- Trond Eivind Glomsrød Red Hat, Inc. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: The Mysql socket thing using Redhat 7.1
jason bailey [EMAIL PROTECTED] writes: HI, I'm a new user to Linux and am interested in MySQL and PHP. I currently use both as a developer elsewhere and am now trying to set up a test server at home. I've searched the MYSQL lists and notice that alot of people are getting a similar problem as myself and I'm not sure if any have got this to work. I'm consistently getting the error (2002) : Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (111) I've read through the manual about problems starting a server but this has not helped and I've tried to follow help in the lists but again no result. I run mysql_install_db and get the messages about starting up I run safe_mysqld and get something about starting and stopping I've found the the mysql.sock and it's in the location that the error mentions the location of the sock thing?? (It's late and I'm tired and a bit fed up -after being told to forget windows and go to Linux- I really wanted to agree but am now finding it hard too!) You shouldn't have done mysql_install_db (which creates db files, owned by root) and safe_mysqld (which will start the database as user mysql, who can't read or write to the necesarry files). Do a chown -R mysql.mysql /var/lib/mysql, then start the database with service mysqld start. If you had done this (or just selected it to start in one of the runlevel managers, like ntsysv or tksysv), it would have initialized the database automatically. To make mysqld start on every boot, do chkconfig mysqld start. -- Trond Eivind Glomsrød Red Hat, Inc. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php