From owner-freebsd-questions@FreeBSD.ORG Sun Jun 28 14:25:45 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 3F638106566C for ; Sun, 28 Jun 2009 14:25:45 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8EE0C8FC12 for ; Sun, 28 Jun 2009 14:25:44 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.3/8.14.3) with ESMTP id n5SEPbV8009975; Sun, 28 Jun 2009 15:25:38 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.8.3 smtp.infracaninophile.co.uk n5SEPbV8009975 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infracaninophile.co.uk; s=200708; t=1246199138; bh=8teYZ3iGKMyr2nCiQHR9eJEwLyY5yDBStxUQzdTuXnU=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Cc:Content-Type:Date:From:In-Reply-To: Message-ID:Mime-Version:References:To; z=Message-ID:=20<4A477D56.7090408@infracaninophile.co.uk>|Date:=20S un,=2028=20Jun=202009=2015:25:26=20+0100|From:=20Matthew=20Seaman= 20|Organization:=20Infracaninophi le|User-Agent:=20Thunderbird=202.0.0.22=20(X11/20090625)|MIME-Vers ion:=201.0|To:=20thanos=20trompoukis=20|CC:=20f reebsd-questions@freebsd.org|Subject:=20Re:=20mysql=20error|Refere nces:=20|In-Reply-To:=20|X-Enigmail-Version:=200.95.6|Content-Type:=20multipar t/signed=3B=20micalg=3Dpgp-sha256=3B=0D=0A=20protocol=3D"applicati on/pgp-signature"=3B=0D=0A=20boundary=3D"------------enigF3B5CF005 8DC303B36725476"; b=zBih89K4ZOXuQsrgHhPUVvQLJ3imnXbtZcGRHdn0rMT4xT2rO7rr4qjdZThUVpvvW kidn+uLdJUVWBRe2pcY3xftQdfOrKCt2yQVdRutlWr/HB+4tau2X3fPrLS8WlYC6vI HoQNeyzhDM/RB4tBNB5x9P24Uh7HCE4CuHk15K0I= X-Authentication-Warning: happy-idiot-talk.infracaninophile.co.uk: Host localhost [IPv6:::1] claimed to be happy-idiot-talk.infracaninophile.co.uk Message-ID: <4A477D56.7090408@infracaninophile.co.uk> Date: Sun, 28 Jun 2009 15:25:26 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.22 (X11/20090625) MIME-Version: 1.0 To: thanos trompoukis References: In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigF3B5CF0058DC303B36725476" X-Virus-Scanned: clamav-milter 0.95.2 at happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on happy-idiot-talk.infracaninophile.co.uk 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 14:25:45 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF3B5CF0058DC303B36725476 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable thanos trompoukis wrote: > Hi all, I am new with FreeBSD and I have a problem with mysql. >=20 > 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:* >=20 > *[root@leonidas:/]$ mysql > ERROR 2002 (HY000): Can't connect to local MySQL server through socket > '/tmp/mysql.sock2' (38)* >=20 > *and when I edit /var/db/mysql/leonidas.MSHOME.err I see this:* >=20 > *090628 14:49:19 mysqld started > 090628 14:49:19 [Warning] Ignoring user change to 'ser=3Dmysql' because= the > user was set to 'mysql' e >=20 > 090628 14:49:20 InnoDB: Started; log sequence number 0 43655 > 090628 14:49:20 [ERROR] Can't start server : Bind on unix socket: Permi= ssion > denied > 090628 14:49:20 [ERROR] Do you already have another mysqld server runni= ng on > socket: /tmp/mysql.soc > 090628 14:49:20 [ERROR] Aborting >=20 > 090628 14:49:20 InnoDB: Starting shutdown... > 090628 14:49:22 InnoDB: Shutdown completed; log sequence number 0 4365= 5 > 090628 14:49:22 [Note] /usr/local/libexec/mysqld: Shutdown complete >=20 > 090628 14:49:22 mysqld ended >=20 > *I have checked /tmp and there is no mysql.sock file. (because I format= ed > /tmp immagine) > I wouldn't like to loose my database, and I have no idea.... > What I have to do? >=20 > Thanx! :D You've apparently got a copy of mysql still running, despite trashing eve= rything 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. Failin= g 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 c= rash without any opportunity to close itself down nicely. * If mysql is listening on a network interface -- preferably any of=20 127.0.0.1:3306, [::1]:3306 or *:3306=20 Try using mysqladmin to shut it down cleanly. Note that mysql does special shortcut things when hostname is localhost and tries to use t= he 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=3DTCP -u root -p shutdow= n 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 th= ese ways. MySQL takes very great pains to ensure data is written to pers= istent 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 la= st things mysql does in the startup sequence '/usr/local/etc/rc.d/mysql-server stat= us' will report 'not running' during this repair work, so be a bit patient if you = see that. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enigF3B5CF0058DC303B36725476 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAkpHfWEACgkQ8Mjk52CukIzw4ACfY0oJ4nhOmYb6yDP/LZtPy1qQ JDkAoJWT0zxJWXJ0AZqykADLkbK861MT =Fj56 -----END PGP SIGNATURE----- --------------enigF3B5CF0058DC303B36725476--