Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MySQL does not run (no socket)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
tot
n00b
n00b


Joined: 09 Jun 2003
Posts: 12
Location: Canada

PostPosted: Thu Dec 04, 2003 5:23 pm    Post subject: Reply with quote

try adding a -p at the end of
mysqladmin -u root -h localhost password ladida -p
like so.
i was getting that error for hours. a major irritance.
Back to top
View user's profile Send private message
violator
n00b
n00b


Joined: 28 Oct 2003
Posts: 25

PostPosted: Mon Dec 15, 2003 8:27 am    Post subject: mysql Reply with quote

has anyone found a solution to this problem? I'm having it too, and I've tried all the methods in the bugs.gentoo.org report, but none seem to work and I can't find any way to fix it. Permissions are set correctly on all dirs, and the /var/tmp solution just makes mysql hang after login.
Back to top
View user's profile Send private message
Decker
Tux's lil' helper
Tux's lil' helper


Joined: 05 Oct 2003
Posts: 98
Location: Germany

PostPosted: Mon Dec 15, 2003 9:26 am    Post subject: Reply with quote

Did you ever try to give all permissions to everyone to /var/run/mysqld/ ?

Why does mysql hang? How did you connect to mysql? Can you please post the contents of the following log files:
/var/log/mysql/mysql.log
/var/log/mysql/mysql.err
Back to top
View user's profile Send private message
jflasch
n00b
n00b


Joined: 02 Sep 2002
Posts: 12

PostPosted: Sun Jan 18, 2004 11:45 pm    Post subject: Reply with quote

My permissions for /var/run were 770. I changed them to 775 and now mysqld works as user mysql. Seems when I made my self user mysql (su - mysql) you can't do a cd /var/run/mysqld or a touch /var/run/mysqld/xx . After the change this works and I can start /etc/init.d/mysql start , and all works..... :lol:
Back to top
View user's profile Send private message
derheld42
Tux's lil' helper
Tux's lil' helper


Joined: 31 Mar 2003
Posts: 97
Location: Washington, US

PostPosted: Tue Jan 27, 2004 2:10 am    Post subject: Reply with quote

Check the permissions of the database directories in /var/lib/mysql:

ls -la /var/lib/mysql

I noticed that mine were owned by root.root -- I don't know how that happened.... and so I fixed them:

cd /var/lib/mysql
chown mysql.root *

Hope it helps!
Back to top
View user's profile Send private message
AceTheFace
n00b
n00b


Joined: 16 Aug 2003
Posts: 49
Location: Germany/Ulm

PostPosted: Thu Mar 18, 2004 8:19 am    Post subject: Reply with quote

Hi there,

i've got this problem, too. After starting mysqld with /etc/init.d/mysql start I can't connect to it:

Code:
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


I changed the permissions of /var/lib/mysql to mysql:root

I can't stop the server without rebooting, because of:

Code:
root@hanf mysql # /etc/init.d/mysql stop
 * Stopping mysqld...                                            [ !! ]


killall mysqld doesn't help.

Is there a workaround to fix this problem? After deleting all configs and re-emerging mysql the problem still does exist :(

Greetz,

Ace
Back to top
View user's profile Send private message
derheld42
Tux's lil' helper
Tux's lil' helper


Joined: 31 Mar 2003
Posts: 97
Location: Washington, US

PostPosted: Thu Mar 18, 2004 8:52 am    Post subject: Reply with quote

What do these two files contain?
/var/log/mysql/mysql.log
/var/log/mysql/mysql.err
Back to top
View user's profile Send private message
AceTheFace
n00b
n00b


Joined: 16 Aug 2003
Posts: 49
Location: Germany/Ulm

PostPosted: Thu Mar 18, 2004 8:58 am    Post subject: Reply with quote

derheld42 wrote:
What do these two files contain?
/var/log/mysql/mysql.log
/var/log/mysql/mysql.err


Solved by "chmod -R +w /var/lib/mysqld"

Greetz,

Ace
Back to top
View user's profile Send private message
rodericj
Tux's lil' helper
Tux's lil' helper


Joined: 08 Mar 2004
Posts: 97
Location: Rockville, MD

PostPosted: Sun Mar 21, 2004 10:17 pm    Post subject: Reply with quote

[quote]
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
[\quote]


And if it doesn't exist?

I seem to see in this thread that everyone has a /var/run/mysqld/mysqld.sock file. I do not.

What does a sock file do? Does it determine the socket information or something?
What do I do in order to find or create mysqld.sock file?

Thanks guys.
Back to top
View user's profile Send private message
rockfly
Apprentice
Apprentice


Joined: 27 Apr 2003
Posts: 179

PostPosted: Sun Mar 21, 2004 10:27 pm    Post subject: Reply with quote

after i updated mysql, it got "solved" :P
Back to top
View user's profile Send private message
infecticide
Apprentice
Apprentice


Joined: 10 Mar 2004
Posts: 262
Location: Regina, SK Canada

PostPosted: Tue Apr 13, 2004 8:33 pm    Post subject: Reply with quote

I've got a slightly different variation of this problem. I'm sure that it has to do with permissions as well. I currently have a WinXP installation on /dev/hda1 and my Gentoo is on /dev/hdb1(boot) and /dev/hdb2(root) I began with Linux by using a copy of Knoppix and I setup a Apache, PHP, MySQL. Worked just fine. I have the same setup on the windows install. When I had knoppix I was able to have it retrevie the files from the windows drive and interact with them without a problem.

I can't seem to get MySQL or Apache to utilize the files on the other drive anymore. I attempted to chown mysql.mysql /mnt/windows/data

Code:
bash-2.05b# chown mysql:mysql /mnt/windows/mysql/data
chown: changing ownership of `/mnt/windows/mysql/data': Operation not permitted


This is what is in mysqld.err

Code:
040413 13:44:04  Fatal error: Can't open privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
040413 13:44:04  Aborting

040413 13:44:04  /usr/sbin/mysqld: Shutdown Complete



Mysql.err

Code:
040413 13:44:04  mysqld started
Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line
040413 13:44:04  Warning: Setting lower_case_table_names=2 because file system for /mnt/windows/mysql/data/ is case insensitive
040413 13:44:04  mysqld ended


Hopefully its something simple but I can't seem to figure it out. Thanks in advance for your help.
Back to top
View user's profile Send private message
infecticide
Apprentice
Apprentice


Joined: 10 Mar 2004
Posts: 262
Location: Regina, SK Canada

PostPosted: Tue Apr 20, 2004 10:27 am    Post subject: Reply with quote

Problem fixed by adding gid=users, uid=0000 to fstab on the vfat line.
Back to top
View user's profile Send private message
b060
n00b
n00b


Joined: 24 Apr 2004
Posts: 70
Location: Mexico formerly known as Tenochtitlan

PostPosted: Mon Apr 26, 2004 10:53 pm    Post subject: Lost mysql pass!! Reply with quote

Kinda stuck here help!!!
Code:
root@ARGOS init.d # mysql_install_db
Installing all prepared tables

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/etc/init.d/mysql start (you have to start the server first!)
/usr/bin/mysqladmin -u root -h ARGOS password 'new-password'
/usr/bin/mysqladmin -u root password 'new-password'
See the manual for more instructions.

NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com

root@ARGOS init.d # /usr/bin/mysqladmin -u root -h ARGOS password
/usr/bin/mysqladmin: connect to server at 'ARGOS' failed
error: 'Lost connection to MySQL server during query'

Hope some one help me
_________________
It's OK to be ignorant; it's not OK to play stupid but its your choice anyway
Back to top
View user's profile Send private message
vyral_surfer
n00b
n00b


Joined: 18 Jul 2004
Posts: 3

PostPosted: Sun Aug 01, 2004 6:30 pm    Post subject: Reply with quote

I had the same problem many of you are having and managed to get rid of it (although now i've got a problem with phpBB accessing the database, but thats for a different topic :) ). I mounted the directory that mysql's databases are stored in (/var/lib/mysql) like this in fstab:
Code:

//highwind/db           /var/lib/mysql  smbfs           password=,gid=mysql,umask=770,dmask=770,fmask=770

The windows machine (Highwind) that the folder is that i keep my databases in (db) is a WindowsXP machine and I haven't gotten around to putting a user account and password for the "//highwind/db" share (but I will in the furture), and thats why I only have a "password=". The way it is set up is users in the "mysql" group can read/write to the databases, while no one else (but root) can. I had to do 770 because, for some reason, 660 wouldn't work.

For the mysqld.sock problem, I had to run:

chmod 774 /var/run/mysqld

Hope this helps! :o
Back to top
View user's profile Send private message
lysergicacid
Guru
Guru


Joined: 25 Nov 2003
Posts: 352
Location: The Universe,Virgo Super Cluster,Milky Way,Earth

PostPosted: Thu Aug 19, 2004 5:01 am    Post subject: Reply with quote

Brazil wrote:
You didn't compile sockets in your kernel probably... it's in the netork section... I dont think you can make into a module either.... you have to compile your kernel again.

genkernel won't help you either.... if you used genkernel then that is why you have this problem.... at least use "genkernel --config"

-Brazil


or if u like me and reading this post because u got same problem u might have to many security options enabled im running hardened-dev-sources which i think is the reason i cant connect to the socket, just an idea tho dont know if it'll help
_________________
[img]http://valid.canardpc.com/cache/banner/2040927.png[/img]
Desktop:
[img]http://valid.canardpc.com/cache/banner/2703952.png[/img]
Back to top
View user's profile Send private message
lysergicacid
Guru
Guru


Joined: 25 Nov 2003
Posts: 352
Location: The Universe,Virgo Super Cluster,Milky Way,Earth

PostPosted: Thu Aug 19, 2004 5:29 am    Post subject: Reply with quote

bah so much for that idea, i dropped all socket restrictions and its still the same
Code:
root@hub: pts/0: 8 files 2.4Mb -> /etc/init.d/mysql stop
 * Stopping mysqld...                                                     [ !! ]

root@hub: pts/0: 8 files 2.4Mb -> /etc/init.d/mysql zap
 * Manually resetting mysql to stopped state.

Thu Aug 19 05:41:24 GMT 2004
~
root@hub: pts/0: 8 files 2.4Mb -> mysqld
040819  5:41:30  Can't start server : Bind on unix socket: No such file or directory
040819  5:41:30  Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
040819  5:41:30  Aborting

040819  5:41:30  mysqld: Shutdown Complete

_________________
[img]http://valid.canardpc.com/cache/banner/2040927.png[/img]
Desktop:
[img]http://valid.canardpc.com/cache/banner/2703952.png[/img]
Back to top
View user's profile Send private message
G3n2
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2004
Posts: 127

PostPosted: Sun Aug 22, 2004 2:53 pm    Post subject: Reply with quote

im getting this error:
Code:

mysqladmin -u root -h amd800_tux password 'PASS'
mysqladmin: connect to server at 'amd800_tux' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'


any way to fix this one ?

mysqladmin -u root password 'PASS' worked :?

[edit]
Also phpadmin says :

Code:

 Server localhost

Error

MySQL said:
#2002 - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)



there is a mysqld.sock file in /var/run/mysqld/mysqld.sock
i see an empty file when i edit it with nano.

and e107 says this :
Code:

 e107 was unable to establish a connection to mySQL using the information you entered.
Please return to the last page and ensure the information is correct.


i can type mysql and make a database
Code:

create database 'database';
grant all privileges *********


im using
Code:
mysql  Ver 12.22 Distrib 4.0.20, for pc-linux-gnu (i386)


with
Code:
Server version: Apache/2.0.50


[edit]
i dont know whats wrong , and i havent had this problem with debian , so can anyone help me fix mysql in Gentoo?
any help would be greatly appreciated.
thx

-G3n2
Back to top
View user's profile Send private message
G3n2
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2004
Posts: 127

PostPosted: Sun Aug 22, 2004 3:18 pm    Post subject: Reply with quote

well , i chmodded 775 to /var/run/mysql and chowned mysql:root to it , now e107 works , but phpmyadmin gives this error :

Code:

Server localhost

Error

MySQL said:
#1045 - Access denied for user: 'root@localhost' (Using password: YES)


thx in advance for any help ;)
-G3n2
Back to top
View user's profile Send private message
qno
n00b
n00b


Joined: 26 Aug 2004
Posts: 1

PostPosted: Thu Aug 26, 2004 10:28 pm    Post subject: Reply with quote

Hello!

I had exactly the same problems - after some searching i found a solution for this problem.

In mysql.err - file was a problem reported with bdb

uninstall mysql and do:

Code:
 USE="-berkdb" emerge mysql


Now everything work's fine ...

cu ...
Back to top
View user's profile Send private message
G3n2
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2004
Posts: 127

PostPosted: Fri Aug 27, 2004 1:10 am    Post subject: Reply with quote

not to pick on u or anything :P

but i have mysql and berkdb together :

Code:

etcat -u mysql
[ Colour Code : set unset ]
[ Legend   : (U) Col 1 - Current USE flags        ]
[          : (I) Col 2 - Installed With USE flags ]

 U I [ Found these USE variables in : dev-db/mysql-4.0.20 ]
 - - static   : !!do not set this during bootstrap!! Causes things to be statically linked instead of dynamically
 + + readline : enables support for libreadline, a GNU line-editing library that most everyone wants.
 - - innodb   : Adds innodb support for mySQL (transaction support)
+ + berkdb   : Adds support for sys-libs/db (Berkeley DB for MySQL)
 + + tcpd     : Adds support for TCP wrappers
 + + ssl      : Adds support for Secure Socket Layer connections
 + + perl     : Adds support/bindings for the Perl language.
 - - debug    : Tells configure and the makefiles to build for debugging. Effects vary across packages, but generally it will at least add -g to CFLAGS. Remember to set FEATURES=nostrip too

ow and it works , but if it fixed ur problem , im happy for you :D
Back to top
View user's profile Send private message
Adwin
Tux's lil' helper
Tux's lil' helper


Joined: 13 Mar 2005
Posts: 128
Location: Poland

PostPosted: Tue Apr 11, 2006 7:05 pm    Post subject: Reply with quote

Fool proof solution is here:

https://forums.gentoo.org/viewtopic.php?t=373031

It seems like the new ebuilds screw around with improper permissions.
Back to top
View user's profile Send private message
maigret
Tux's lil' helper
Tux's lil' helper


Joined: 12 Aug 2004
Posts: 139
Location: Germany

PostPosted: Mon Apr 17, 2006 4:10 pm    Post subject: Reply with quote

For me, the solution was in this topic:

https://forums.gentoo.org/viewtopic-t-361978-highlight-error+iblogfile0+mysql.html
Back to top
View user's profile Send private message
richard.scott
Veteran
Veteran


Joined: 19 May 2003
Posts: 1497
Location: Oxfordshire, UK

PostPosted: Tue Apr 18, 2006 11:56 am    Post subject: Reply with quote

I think that I've found a possible fix for this :)

When executing /etc/init.d/mysql for the first time, it tells us to run the mysql_install_db

and when you execute mysql_install_db it doesn't set the file access rights on /var/lib/mysql/*

to fix this, I've been running:

Code:
# /usr/bin/mysql_install_db --user=mysql


and that has set the access rights so MySQL will start!

I Hope this helps someone.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum