From owner-freebsd-questions@FreeBSD.ORG Sun Jun 28 17:15:29 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3148A106566C for ; Sun, 28 Jun 2009 17:15:29 +0000 (UTC) (envelope-from atr0x23@gmail.com) Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF7E8FC0C for ; Sun, 28 Jun 2009 17:15:28 +0000 (UTC) (envelope-from atr0x23@gmail.com) Received: by bwz6 with SMTP id 6so406342bwz.43 for ; Sun, 28 Jun 2009 10:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=xQogTD1WbN1vo+0rSop3am7NDXdXFxhTyrOqkBK9NHQ=; b=FvmSzLcCnP/u4ueKeFRF8PTTD5x8m8pGNrkze5OJePVR+b2xWieW1H0MWhyoTLr/ZI /zMGzp8RZfcGcHIQX8Rc6x+2LmRDID9Cme/O5OEviajbfWz7lLTDgZkqcnKU+Y8sIrmy YYYzZWOW6juGySeM5VOPPhoeNjsxNnJS7krCY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=iyJpy1I0VI4ovpIEyafExhPQyA/BHCq9Xx6cJaysjTfo54sZ5fwSpF/uTu64F4o4Cj W2J9QPPqEJCdIsylKe79y6HUswDKfcl3rV7k57kWE7eYvatj5fzgvgtkslss84X4JZoe VWaI1jw8eShL9EhGMPpA9oSFgBnm30OfMrWX8= MIME-Version: 1.0 Received: by 10.223.121.6 with SMTP id f6mr3992246far.77.1246209327507; Sun, 28 Jun 2009 10:15:27 -0700 (PDT) In-Reply-To: <4A477D56.7090408@infracaninophile.co.uk> References: <4A477D56.7090408@infracaninophile.co.uk> Date: Sun, 28 Jun 2009 20:15:27 +0300 Message-ID: From: thanos trompoukis To: Matthew Seaman Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: mysql error X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2009 17:15:29 -0000 2009/6/28 Matthew Seaman > thanos trompoukis wrote: > >> Hi all, I am new with FreeBSD and I have a problem with mysql. >> >> I have 6.2Release i386 >> I am running mysql 5.0.27 and It worked perfectly until the time that I >> formated /tmp (for some other reason) >> and now when I am trying to connect on mysql *I get this:* >> >> *[root@leonidas:/]$ mysql >> ERROR 2002 (HY000): Can't connect to local MySQL server through socket >> '/tmp/mysql.sock2' (38)* >> >> *and when I edit /var/db/mysql/leonidas.MSHOME.err I see this:* >> >> *090628 14:49:19 mysqld started >> 090628 14:49:19 [Warning] Ignoring user change to 'ser=mysql' because the >> user was set to 'mysql' e >> >> 090628 14:49:20 InnoDB: Started; log sequence number 0 43655 >> 090628 14:49:20 [ERROR] Can't start server : Bind on unix socket: >> Permission >> denied >> 090628 14:49:20 [ERROR] Do you already have another mysqld server running >> on >> socket: /tmp/mysql.soc >> 090628 14:49:20 [ERROR] Aborting >> >> 090628 14:49:20 InnoDB: Starting shutdown... >> 090628 14:49:22 InnoDB: Shutdown completed; log sequence number 0 43655 >> 090628 14:49:22 [Note] /usr/local/libexec/mysqld: Shutdown complete >> >> 090628 14:49:22 mysqld ended >> >> *I have checked /tmp and there is no mysql.sock file. (because I formated >> /tmp immagine) >> I wouldn't like to loose my database, and I have no idea.... >> What I have to do? >> >> Thanx! :D >> > > You've apparently got a copy of mysql still running, despite trashing > everything > in /tmp. You can confirm that by: > > % sockstat | grep mysql > > Now, if sockstat shows that mysql is listening on a network interface, > then you may just be able to log into it over a network connection and > shut it down cleanly. If not, then you have no alternative by to signal > the process to death and then let it repair the datafiles as it restarts. > > * If you have to kill mysql by signalling it: > > At first, try: > > # kill -15 `ps -ax | grep mysqld | cut -d ' ' -f 2` > > If it doesn't work immediately, leave mysql for 5 minutes, and see if it > has shut down yet. Try again if not, possibly several times. Failing > that, > use: > > # kill -9 `ps -ax | grep mysqld | cut -d ' ' -f 2` > > But this last really should be avoided, as it causes the process to crash > without any opportunity to close itself down nicely. > > * If mysql is listening on a network interface -- preferably any of > 127.0.0.1:3306, [::1]:3306 or *:3306 > Try using mysqladmin to shut it down cleanly. Note that mysql does > special shortcut things when hostname is localhost and tries to use the > socket in /tmp/mysql.sock -- which doesn't help you at all. You can > force > it to make a *network* connection to localhost by: > > # mysqladmin -h localhost -P 3306 --protocol=TCP -u root -p shutdown > > This will prompt you for the mysql root password. If mysqladmin doesn't > work, > then try using kill as above. > > Your data *should* survive MySQL being forcibly restarted in either of > these ways. MySQL takes very great pains to ensure data is written to > persistent media (ie. > disk) in order to provide proper ACID compliance. However, if mysql does > get killed, it will need to do some repair work on data structures when it > next starts up, and > that can take a while. Because writing out its PID file is one of the last > things > mysql does in the startup sequence '/usr/local/etc/rc.d/mysql-server > status' will > report 'not running' during this repair work, so be a bit patient if you > see that. > > Cheers, > > Matthew > > -- > Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard > Flat 3 > PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate > Kent, CT11 9PW Thanx! thank you very much guys..! Finaly it was so simple!!! aaahhhh, god bless you!!!!!! Thanx again..!!!!