Bekanntes MySQL-Server Permissionproblem

MySQL, PostgreSQL, SQLite
nasi
Posts: 6
Joined: 2006-05-05 11:01

Bekanntes MySQL-Server Permissionproblem

Post by nasi » 2007-06-04 14:56

Hallo,

ich habe wie auch viele andere ein Problem mit den Rechten von MySQL. SObald ich den Server starten will kommt:

Code: Select all

 mysqld: Can't read dir of '/tmp/' (Errcode: 13)
070604 12:43:19 [ERROR] Can't start server : Bind on unix socket: Permission denied
070604 12:43:19 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
070604 12:43:19 [ERROR] Aborting

070604 12:43:19 [Note] mysqld: Herunterfahren beendet
Ich habe bereits Rechte gesetzt und alles erdenklich mögliche und wa sim Internet seit einem Monat zu finden ist versucht, leider alles ohne Erfolg. Ich bewege mich kein Stück von der Stelle.

System: Debian 4.0 Etch
MySQL: mysqld Ver 5.0.32-Debian_7etch1-log for pc-linux-gnu on i486
Kernel: 2.6.18-4-486
Zugriff: remote/ ssh only


Kurzer Auszug ausm syslog:

Code: Select all

Jun  4 12:46:51 schauf1 mysqld_safe[13381]: started
Jun  4 12:46:51 schauf1 mysqld[13384]: ^G/usr/sbin/mysqld: Can't read dir of '/tmp/' (Errcode: 13)
Jun  4 12:46:51 schauf1 mysqld[13384]: 070604 12:46:51 [ERROR] Can't start server : Bind on unix socket: Permission denied
Jun  4 12:46:51 schauf1 mysqld[13384]: 070604 12:46:51 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
Jun  4 12:46:51 schauf1 mysqld[13384]: 070604 12:46:51 [ERROR] Aborting
Jun  4 12:46:51 schauf1 mysqld[13384]:
Jun  4 12:46:51 schauf1 mysqld[13384]: 070604 12:46:51 [Note] /usr/sbin/mysqld: Herunterfahren beendet
Jun  4 12:46:51 schauf1 mysqld[13384]:
Jun  4 12:46:51 schauf1 mysqld_safe[13386]: ended
Jun  4 12:47:06 schauf1 /etc/init.d/mysql[13521]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Jun  4 12:47:06 schauf1 /etc/init.d/mysql[13521]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
Jun  4 12:47:06 schauf1 /etc/init.d/mysql[13521]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Jun  4 12:47:06 schauf1 /etc/init.d/mysql[13521]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Jun  4 12:47:06 schauf1 /etc/init.d/mysql[13521]:

Verzeichnisse und Rechte:

/tmp/

Code: Select all

drwxrwxrwt  4 root  root         4096 2007-06-04 11:44 tmp
Chmod: 777

/var/run/mysqld/

Code: Select all

drwxr-xr-x  2 mysql       mysql       4096 2007-06-04 12:46 mysqld

Meine my.cnf (/etc/mysql/my.cnf)

Code: Select all

[client]
character-sets-dir    = /usr/share/mysql/charsets
default-character-set = latin1
port                  = 3306
socket                = /var/run/mysqld/mysqld.sock

[mysql]
character-sets-dir    = /usr/share/mysql/charsets
default-character-set = latin1
no-auto-rehash

[mysqladmin]
character-sets-dir    = /usr/share/mysql/charsets
default-character-set = latin1

[mysqlcheck]
character-sets-dir    = /usr/share/mysql/charsets
default-character-set = latin1

[mysqldump]
character-sets-dir    = /usr/share/mysql/charsets
default-character-set = latin1
max_allowed_packet    = 16M
quick

[mysqlimport]
character-sets-dir    = /usr/share/mysql/charsets
default-character-set = latin1

[mysqlshow]
character-sets-dir    = /usr/share/mysql/charsets
default-character-set = latin1

[isamchk]
character-sets-dir    = /usr/share/mysql/charsets
key_buffer_size       = 256M
sort_buffer_size      = 256M
read_buffer_size      = 4M
write_buffer_size     = 4M

[myisamchk]
character-sets-dir    = /usr/share/mysql/charsets
key_buffer_size       = 256M
sort_buffer_size      = 256M
read_buffer_size      = 4M
write_buffer_size     = 4M

[myisampack]
character-sets-dir    = /usr/share/mysql/charsets

[mysqld_safe]
err-log               = /var/log/mysql/mysql.err
open-files-limit      = 4096

[mysqld]
character-sets-dir    = /usr/share/mysql/charsets
character-set-server  = latin1
default-character-set = latin1
user                  = mysql
port                  = 3306
bind-address          = 213.240.162.35
socket                = /var/run/mysqld/mysqld.sock
pid-file              = /var/run/mysqld/mysqld.pid
log-error             = /var/log/mysql/mysqld.err
basedir               = /usr/local/mysql
datadir               = /var/lib/mysql
tmpdir                = /tmp
language              = /usr/share/mysql/german/
log-bin               = mysql-bin
server-id             = 1
sync_binlog           = 1
binlog_cache_size     = 1M
max_binlog_size       = 10M
slave_compressed_protocol = 1
delay-key-write       = ALL
skip-locking
#skip-networking
skip-name-resolve
skip-external-locking
skip-show-database
safe-user-create      = 1
default_table_type    = MYISAM
transaction_isolation = REPEATABLE-READ
max_allowed_packet    = 16M
max_heap_table_size   = 64M
tmp_table_size        = 64M
key_buffer_size       = 384M
sort_buffer_size      = 8M
join_buffer_size      = 8M
read_buffer_size      = 8M
read_rnd_buffer_size  = 16M
bulk_insert_buffer_size = 32M
myisam_sort_buffer_size = 64M
myisam_max_sort_file_size = 1G
myisam_max_extra_sort_file_size = 1G
myisam_repair_threads = 1
thread_cache_size     = 8
table_cache           = 512
query_cache_type      = 1
query_cache_size      = 32M
query_cache_limit     = 2M
thread_concurrency    = 8
local-infile          = 0
long_query_time       = 3
log_slow_queries
log_long_format
myisam_recover
skip-innodb
innodb_thread_concurrency = 8
innodb_buffer_pool_size = 384M
innodb_additional_mem_pool_size = 20M
innodb_data_home_dir = /var/lib/mysql
innodb_log_arch_dir = /var/lib/mysql
innodb_log_group_home_dir = /var/lib/mysql
innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
innodb_log_file_size = 100M
innodb_log_buffer_size = 8M
innodb_log_files_in_group = 2
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 60

[mysqlhotcopy]
interactive-timeout

Ich hoffe ich hab alle nötigen Informationen gepostet. Bin für jeden Tipp dankbar!

lord_pinhead
RSAC
Posts: 830
Joined: 2004-04-26 15:57

Re: Bekanntes MySQL-Server Permissionproblem

Post by lord_pinhead » 2007-06-05 00:03

Hast du /tmp vielleicht falsch gemountet oder ist das gar nicht gemountet?

flo
RSAC
Posts: 2297
Joined: 2002-07-28 13:02
Location: Berlin

Re: Bekanntes MySQL-Server Permissionproblem

Post by flo » 2007-06-05 08:55

Code: Select all

mount
und

Code: Select all

df -h
bitte - alternativ gib ihm doch mal ein anderes tmp-Verzeichnis und schau, ob er dann startet, bitte schau nach dem herunterfahren auch noch, ob wirklich alle mysql-Prozesse weg sind.

nasi
Posts: 6
Joined: 2006-05-05 11:01

Re: Bekanntes MySQL-Server Permissionproblem

Post by nasi » 2007-06-05 14:26

Schonmal vielen Dank für eure Tipps, ich hab se mir direkt mal zu Herzen genommen und "/tmp/" auf eine eigene Partition gelegt und es nochmals getestet.

Code: Select all

content:/# mount
/dev/hda2 on / type ext3 (rw,errors=remount-ro,usrquota)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/hdb3 on /mnt/old_hdd3 type ext3 (rw)
/dev/hdb1 on /tmp type ext3 (rw)

Code: Select all

content:/# df -h
Dateisystem          Größe Benut  Verf Ben% Eingehängt auf
/dev/hda2              73G  1,4G   68G   2% /
tmpfs                 253M     0  253M   0% /lib/init/rw
udev                   10M   48K   10M   1% /dev
tmpfs                 253M     0  253M   0% /dev/shm
/dev/hdb3              75G   39G   32G  55% /mnt/old_hdd3
/dev/hdb1              89M  4,1M   80M   5% /tmp

Code: Select all

drwxrwxrwt  2 root  root         1024 2007-06-05 12:12 tmp
Aber leider der gleiche Fehler wie sonst auch, Errcode 13 ... "Can`t read dir of "/tmp/"


Zu den Prozessen:

Code: Select all

content:/# ps aux | grep mysql
root     16206  0.0  0.1   2024   736 pts/1    R+   12:22   0:00 grep mysql
content:/#

Code: Select all

content:/# find / -name *pid | grep mysql
/usr/bin/mysql_waitpid
/root/mysql-5.0.41-linux-i686-glibc23/bin/mysql_waitpid
Nix da :(

nasi
Posts: 6
Joined: 2006-05-05 11:01

Re: Bekanntes MySQL-Server Permissionproblem

Post by nasi » 2007-06-05 14:33

Hab grad nochma was getestet ... Es scheint ein allgemeines Problem mit dem "mysql" User zu sein wenn ich das richtig interpretiere ...

Code: Select all

content:/# mysqld -u mysql
mysqld: Can't read dir of '/tmp/' (Errcode: 13)
mysqld: File '/var/log/mysql/mysql.log' not found (Errcode: 13)
070605 12:28:33 [ERROR] Could not use /var/log/mysql/mysql.log for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
mysqld: File '/var/log/mysql/mysql-bin.index' not found (Errcode: 13)
070605 12:28:33 [ERROR] Aborting

070605 12:28:33 [Note] mysqld: Shutdown complete

Code: Select all

content:/# perror 13
OS error code  13:  Permission denied

User avatar
Joe User
Project Manager
Project Manager
Posts: 11614
Joined: 2003-02-27 01:00
Location: Hamburg

Re: Bekanntes MySQL-Server Permissionproblem

Post by Joe User » 2007-06-05 14:46

Stimmen alle Pfade in der my.cnf? Mal mit /var/tmp statt /tmp versucht?

Code: Select all

ls -alh /var/{lib,log}/mysql*
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.

nasi
Posts: 6
Joined: 2006-05-05 11:01

Re: Bekanntes MySQL-Server Permissionproblem

Post by nasi » 2007-06-05 15:01

*schäääm* Da muss ich grad leider mal passen ... Das übersteigt meine Linuxkompetenzen :(

Auszug:

Code: Select all

content:/# ls -alh /var/{lib,log}/mysql*
-rw-r----- 1 mysql adm      0 2007-06-05 12:12 /var/log/mysql.err
-rw-r----- 1 mysql adm      0 2007-06-05 12:12 /var/log/mysql.log
-rw-r----- 1 mysql adm     20 2007-06-04 11:44 /var/log/mysql.log.1.gz

/var/lib/mysql:
insgesamt 208K
drwxr-xr-x  3 mysql mysql 4,0K 2007-06-05 12:28 .
drwxr-xr-x 26 root  root  4,0K 2007-06-05 12:12 ..
-rw-rw----  1 mysql mysql 8,4K 2007-06-05 12:24 content-slow.log
-rw-r--r--  1 mysql mysql    0 2007-06-05 12:12 debian-5.0.flag
drwxr-xr-x  2 mysql mysql 4,0K 2007-06-04 11:44 mysql
-rw-rw----  1 mysql mysql  117 2007-06-04 12:10 mysql-bin.000001
-rw-rw----  1 mysql mysql  117 2007-06-04 12:19 mysql-bin.000002
-rw-rw----  1 mysql mysql  117 2007-06-04 12:20 mysql-bin.000003
-rw-rw----  1 mysql mysql  117 2007-06-04 12:25 mysql-bin.000004
-rw-rw----  1 mysql mysql  117 2007-06-04 12:25 mysql-bin.000005
-rw-rw----  1 mysql mysql  117 2007-06-04 12:26 mysql-bin.000006
-rw-rw----  1 mysql mysql  117 2007-06-04 12:26 mysql-bin.000007
-rw-rw----  1 mysql mysql  117 2007-06-04 12:28 mysql-bin.000008
-rw-rw----  1 mysql mysql  117 2007-06-04 12:29 mysql-bin.000009
-rw-rw----  1 mysql mysql  117 2007-06-04 12:29 mysql-bin.000010
-rw-rw----  1 mysql mysql  117 2007-06-04 12:29 mysql-bin.000011
-rw-rw----  1 mysql mysql  117 2007-06-04 12:29 mysql-bin.000012
-rw-rw----  1 mysql mysql  117 2007-06-04 12:32 mysql-bin.000013
-rw-rw----  1 mysql mysql  117 2007-06-04 12:33 mysql-bin.000014
-rw-rw----  1 mysql mysql  117 2007-06-04 12:33 mysql-bin.000015
-rw-rw----  1 mysql mysql  117 2007-06-04 12:34 mysql-bin.000016
-rw-rw----  1 mysql mysql  117 2007-06-04 12:35 mysql-bin.000017
-rw-rw----  1 mysql mysql  117 2007-06-04 12:37 mysql-bin.000018
-rw-rw----  1 mysql mysql  117 2007-06-04 12:43 mysql-bin.000019
-rw-rw----  1 mysql mysql  117 2007-06-04 12:46 mysql-bin.000020
-rw-rw----  1 mysql mysql  117 2007-06-04 13:06 mysql-bin.000021
-rw-rw----  1 mysql mysql  117 2007-06-04 13:08 mysql-bin.000022
-rw-rw----  1 mysql mysql  117 2007-06-05 11:48 mysql-bin.000023
-rw-rw----  1 mysql mysql  117 2007-06-05 11:50 mysql-bin.000024
-rw-rw----  1 mysql mysql  117 2007-06-05 11:52 mysql-bin.000025
-rw-rw----  1 mysql mysql  117 2007-06-05 12:10 mysql-bin.000026
-rw-rw----  1 mysql mysql  117 2007-06-05 12:11 mysql-bin.000027
-rw-rw----  1 mysql mysql  117 2007-06-05 12:11 mysql-bin.000028
-rw-rw----  1 mysql mysql  117 2007-06-05 12:11 mysql-bin.000029
-rw-rw----  1 mysql mysql  117 2007-06-05 12:11 mysql-bin.000030
-rw-rw----  1 mysql mysql  117 2007-06-05 12:11 mysql-bin.000031
-rw-rw----  1 mysql mysql  117 2007-06-05 12:11 mysql-bin.000032
-rw-rw----  1 mysql mysql  117 2007-06-05 12:11 mysql-bin.000033
-rw-rw----  1 mysql mysql  117 2007-06-05 12:11 mysql-bin.000034
-rw-rw----  1 mysql mysql  117 2007-06-05 12:11 mysql-bin.000035
-rw-rw----  1 mysql mysql  117 2007-06-05 12:12 mysql-bin.000036
-rw-rw----  1 mysql mysql  117 2007-06-05 12:12 mysql-bin.000037
-rw-rw----  1 mysql mysql  117 2007-06-05 12:12 mysql-bin.000038
-rw-rw----  1 mysql mysql  117 2007-06-05 12:12 mysql-bin.000039
-rw-rw----  1 mysql mysql  117 2007-06-05 12:12 mysql-bin.000040
-rw-rw----  1 mysql mysql  117 2007-06-05 12:14 mysql-bin.000041
-rw-rw----  1 mysql mysql  117 2007-06-05 12:15 mysql-bin.000042
-rw-rw----  1 mysql mysql  117 2007-06-05 12:16 mysql-bin.000043
-rw-rw----  1 mysql mysql  117 2007-06-05 12:23 mysql-bin.000044
-rw-rw----  1 mysql mysql  117 2007-06-05 12:24 mysql-bin.000045
-rw-rw----  1 mysql mysql  855 2007-06-05 12:24 mysql-bin.index

/var/lib/mysql-cluster:
insgesamt 8,0K
drwxr-xr-x  2 root root 4,0K 2007-03-18 22:05 .
drwxr-xr-x 26 root root 4,0K 2007-06-05 12:12 ..

/var/log/mysql:
insgesamt 68K
drwxr-s--- 2 mysql adm  4,0K 2007-06-04 12:32 .
drwxr-xr-x 9 root  root 4,0K 2007-06-05 06:25 ..
-rw-r--r-- 1 mysql adm     0 2007-06-04 10:48 mysql-bin.index

Hab ma alle Pfade angeschaut und es sind alle Dateien und Pfade richtig ... Ich gehe echt von nem Rechteproblem aus ... Man siehe z.B. die mysql-bin.index ist vorhanden, kann aber nicht drauf zugreifen :(

User avatar
Joe User
Project Manager
Project Manager
Posts: 11614
Joined: 2003-02-27 01:00
Location: Hamburg

Re: Bekanntes MySQL-Server Permissionproblem

Post by Joe User » 2007-06-05 16:02

Code: Select all

/etc/init.d/mysql stop
rm /var/run/mysqld/*
rm -r /var/log/mysql*
mkdir /var/log/mysql
chown mysql:mysql /var/log/mysql
/etc/init.d/mysql start
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.

nasi
Posts: 6
Joined: 2006-05-05 11:01

Re: Bekanntes MySQL-Server Permissionproblem

Post by nasi » 2007-06-05 16:09

- done -


Same problem :(

nasi
Posts: 6
Joined: 2006-05-05 11:01

Re: Bekanntes MySQL-Server Permissionproblem

Post by nasi » 2007-06-08 12:28

Server neu installiert, Problem weg ...