From owner-freebsd-questions@FreeBSD.ORG Tue Jul 10 13:50:32 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1541C16A421 for ; Tue, 10 Jul 2007 13:50:32 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by mx1.freebsd.org (Postfix) with ESMTP id 97E8213C468 for ; Tue, 10 Jul 2007 13:50:31 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: by ug-out-1314.google.com with SMTP id o4so1644771uge for ; Tue, 10 Jul 2007 06:50:30 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer; b=Nv5oU/jFBmDX1gr8yTHFA96hvF8SjfL9dZOfBdkV68q9+vKSa+yB4l4T0pL1iGf1StpIHnWrQLR12/FjXaCEbom9z9LGsF1JqnYrweQ3v7nN7dqhZpekE82UzUFg3lHqq0ZzHTXD0XngcIE1JiufDRVpTeBY6QSN1e9j8EKJb9w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer; b=NFLz0RY2Br83kjQzwSNbphNnA3I3Fwe2CjAU2nC8DWeqlqWfDRn49YCa9u2t6kG+FBYq2w7JbHcldlAUusI38UIvlMZWOq2nO2u558ndAC0y3ryXFVbnLypO0xK//Cxs8b2S8Q6ZHxI8/cHThccgGAejVrQpwbHmWMYKPOhs1HE= Received: by 10.82.189.6 with SMTP id m6mr9624765buf.1184075430337; Tue, 10 Jul 2007 06:50:30 -0700 (PDT) Received: from ?IPv6:::ffff:127.0.0.1? ( [217.206.187.79]) by mx.google.com with ESMTP id i7sm19596107nfh.2007.07.10.06.50.28 (version=SSLv3 cipher=RC4-MD5); Tue, 10 Jul 2007 06:50:29 -0700 (PDT) From: Tom Evans To: Duane Hill In-Reply-To: <20070710121422.S27505@duane.dbq.yournetplus.com> References: <20070710115624.K27424@duane.dbq.yournetplus.com> <20070710121422.S27505@duane.dbq.yournetplus.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-tBT01zXFNefDjo0w14Gi" Date: Tue, 10 Jul 2007 14:50:26 +0100 Message-Id: <1184075426.1228.12.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.2 FreeBSD GNOME Team Port Cc: freebsd-questions@FreeBSD.ORG Subject: Re: accessing mysql server remotely 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: Tue, 10 Jul 2007 13:50:32 -0000 --=-tBT01zXFNefDjo0w14Gi Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2007-07-10 at 12:15 +0000, Duane Hill wrote: > On Tue, 10 Jul 2007 at 12:01 -0000, d.hill@yournetplus.com confabulated: >=20 > > On Mon, 9 Jul 2007 at 23:33 -0400, fbsd@a1poweruser.com confabulated: > > > >> Just a general question about mysql remote access. > >>=20 > >> Is it possible to login to my remote mysql server and create a > >> new db & table using a file on the local system which contains > >> the definition statements? > > > > Sure. As long as the account name used to login to MySQL has login acce= ss=20 > > from the remote location. > > > > mysql -host=3Dip_or_hostname -user=3Dusername -password=3Dpassword dbna= me <=20 > > statements.sql >=20 > My bad. The command line parameters should have two hyphens: >=20 > mysql --host=3Dip_or_hostname --user=3Dusername --password=3Dpassword dbn= ame < statements.sql >=20 Whilst this syntax will work fine, it requires that the mysql server allow remote logins - well I already have a nice cryptographically secure way of allowing remote access, it's called SSH: cat statements.sql |\=20 ssh -C user@hostname 'mysql -u -p ' The main benefit of this is that my mysql server now only needs to run on localhost, and so cannot be touched by any external user. For an interactive mysql prompt, you'd need either to open up mysql, or forward a port: ssh -C -L13306:localhost:3306 user@hostname mysql -u -p -hlocalhost -P13306 --=-tBT01zXFNefDjo0w14Gi Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQBGk46ilcRvFfyds/cRAsgrAJ0Xld2Tyam5Cu23rZyclaOSoujEiQCgkv/C vUupMrJHvtJP1EUqwmbctsU= =pqjh -----END PGP SIGNATURE----- --=-tBT01zXFNefDjo0w14Gi--