Jump to content
php.lv forumi

socket fails


ViszinisA

Recommended Posts

tipa

 

Serveris: Ubuntu + MySQL 5 + Apache

 

serveris stradaaja normaali...es neko tur nedariiju...(gandriiz, tikai index failu uztaisiiju ar skaistu bildiiti :D)

 

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

 

Q1: kapeec tas fails pazuda?

Q2: kur vinjsh pazuda?

Q3: ko dariit? (ir ideja vnk paaristaleet un meeginaat kaut ko izdariit savadaak, bik rupiigaak)

 

 

p.s. es neko neizdariiju, pilniigi neko,

serveris staaveeja nedeelju bez darba...un visss

 

aa un FTP var ieiet bet neko nevar izdariit,

jo tas fails satur user'us un atljaujas (vai kas tml)

Edited by ViszinisA
Link to comment
Share on other sites

root@w25:~# /etc/init.d/mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.
.
.
.
.
.
.
.
.
.
.
.
.
.
...failed or took more than 6s.
	Please take a look at the syslog.
/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!

 

nu un? :D nekas nestraadaa tik un taa ^_^

 

Q1: kas zin? pacelj roku un pastaasta :)

Link to comment
Share on other sites

wtf? caur mysql klient tūli neviens nerestartē...

 

cat /etc/rc.d/rc.mysql
#!/bin/sh

# Start MySQL Daemon

#exit;

BASE_DIR=/usr/local/mysql
DATA_DIR=/data/db/mysql
MYSQL_PID=$DATA_DIR/mysql.pid



# Start mysqld:
mysqld_start() {
 if [ -x $BASE_DIR/bin/mysqld_safe ]; then
if [ -r $MYSQL_PID ]; then
  if ! ps ax | grep mysqld 1> /dev/null 2> /dev/null; then
	echo "Cleaning up old $MYSQL_PID."
	rm -f $PIDFILE
  fi
fi
$BASE_DIR/bin/mysqld_safe \
			--basedir=$BASE_DIR \
			--datadir=$DATA_DIR \
			--pid-file=$MYSQL_PID $SKIP &
 fi
}

# Stop mysqld:
mysqld_stop() {
 if [ -r $MYSQL_PID ]; then
killall mysqld
for second in 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 \
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 60; do
  if [ ! -r $MYSQL_PID ]; then
	break;
  fi
  sleep 1
done
if [ "$second" = "60" ]; then
  echo "WARNING:  Gave up waiting for mysqld to exit!"
  sleep 15
fi
 fi
}

# Restart mysqld:
mysqld_restart() {
 mysqld_stop
 mysqld_start
}

case "$1" in
'start')
 mysqld_start
;;
'stop')
 mysqld_stop
;;
'restart')
 mysqld_restart
;;
*)
 echo "Usage: $0 start|stop|restart"
esac

Link to comment
Share on other sites

Delfins /etc/init.d/mysql nav mysql clients bet init scripts (tas pats tavs rc.mysql).

 

 

piešķir tiesības mysql`am izmantot to sock failu.

ja tāda faila mav, uztaisi.

ja tāds fails ir citur, nekā mysql viņu meklē - ln -s

Nedari neko no šī minētā..

 

 

Patiesībā vajag paskatīties mysql error failu..

Parasti stāv zem /var/lib/mysql/[hostname].err (jebšu tur kur mysqlam ir datadir/basedir) proti pamēģini tail /var/lib/mysql/*.err un paskaties kas tur rakstīts.

Link to comment
Share on other sites

Aiz kam nav jēgas prasīt padomus ja tāpat neko no teiktā nedari..

 

taa gan nesaki...es pameeginaaju...nesanaaca

 

un domaa es googles tantei neko neprasiiju?

 

un arii es pabiju forums.mysql.com (nekaa sakariiga)

 

tad nu naak variants ar re-instal

Link to comment
Share on other sites

×
×
  • Create New...