Re: ssh basics

2015-03-23 Thread Michael Dykman
There are several weird hybrid ways of installing MySQL on Mac (the native
install as provided by Apple, tar or dmg from Oracle, Darwin Ports, brew
and Fink, if the latter is still around) all of which are utterly mutually
incompatible.  But once it is up, it's behaviour is the same as a typical
unix install, once you have guessed where the files went.

On Sun, Mar 22, 2015 at 6:54 PM, Thufir hawat.thu...@gmail.com wrote:

 Lucio Chiappetti lucio at lambrate.inaf.it writes:
 ..
  Conversely, I have some private databases on my machine B. While I
  maintain them locally with full access, I grant select access to an user
  on another machine C. In this case he runs the mysql client on C which
  connects to the mysqld on my machine B (actually he runs shell scripts
  which do it).
 
  I guess all this very simple arrangements should cover the needs of the
 OP
  as they do for me..
 ..

 Unless you have to switch to Mac, which has a strange hybrid way of
 installing MySQL...

 It's clear that ssh is the better solution, even if a bit more work to
 setup, sometimes.



 -Thufir


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql




-- 
 - michael dykman
 - mdyk...@gmail.com

 May the Source be with you.


Re: ssh basics

2015-03-22 Thread Thufir
Lucio Chiappetti lucio at lambrate.inaf.it writes:
..
 Conversely, I have some private databases on my machine B. While I 
 maintain them locally with full access, I grant select access to an user 
 on another machine C. In this case he runs the mysql client on C which 
 connects to the mysqld on my machine B (actually he runs shell scripts 
 which do it).
 
 I guess all this very simple arrangements should cover the needs of the OP 
 as they do for me..
..

Unless you have to switch to Mac, which has a strange hybrid way of
installing MySQL...

It's clear that ssh is the better solution, even if a bit more work to
setup, sometimes.



-Thufir


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-12 Thread Johan De Meersman
- Original Message -
 From: Thufir hawat.thu...@gmail.com
 Subject: Re: ssh basics

 On Mon, 09 Mar 2015 16:00:08 +0100, Johan De Meersman wrote:
 
 All in all, you've done the opposite of what I asked - you've told me
 what you know and tried, but not what you were trying to figure out with
 your original question :-p

Sounds like you mostly have a lot of fun, then :-p


-- 
Unhappiness is discouraged and will be corrected with kitten pictures.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-11 Thread Thufir
On Mon, 09 Mar 2015 16:00:08 +0100, Johan De Meersman wrote:

 All in all, you've done the opposite of what I asked - you've told me
 what you know and tried, but not what you were trying to figure out with
 your original question :-p


Do I really look like a guy with a plan? You know what I am? I'm a dog 
chasing cars. I wouldn't know what to do with one if I caught it. You 
know, I just... do things. 

 Under the assumption that you wanted to use ssh to magically have a
 mysql prompt appear on your console:
 * [ssh -t user@host mysql] will log in to your machine and start the
 mysql client. The -t tells SSH to allocate a pseudoterminal even though
 you specified a command to run.


Now, that sounds like a plan!



-thufir


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-10 Thread Lucio Chiappetti

On Mon, 9 Mar 2015, Johan De Meersman wrote:


I'm interested in how ssh is used by MySQL.


SSH is not used by MySQL at all :-) SSH is a way of connecting to a 
remote machine. MySQL is a database. You can use SSH to do things with 
the database, but they're not intrinsically related.


True, howewer the OP might be interested knowing that I do continuously 
work on a mysql astronomical database on a different machine A (here on my 
institute LAN) from MY machine B just opening an xterm in which I ssh to 
such machine A, and then run the line-mode mysql client on such machine A.


We do not offer mysql client access to such database outside of our 
institute, and in general not even to machines in our institute. For that 
we have a java tomcat client which connects via JDBC to the database.


Since tomcat and mysqld run on the same machine A, we grant access only to 
a single user on localhost.



Conversely, I have some private databases on my machine B. While I 
maintain them locally with full access, I grant select access to an user 
on another machine C. In this case he runs the mysql client on C which 
connects to the mysqld on my machine B (actually he runs shell scripts 
which do it).


I guess all this very simple arrangements should cover the needs of the OP 
as they do for me.



I may like a way to have a program (namely RSI IDL) to connect (bypassing 
the line mode mysql client) to the mysqld socket and issuing commands to 
it (essentially I want to issue a select into a table, and read back the 
output in an IDL structure) but I never managed to do it. But I did not 
try hard.


--

Lucio Chiappetti - INAF/IASF - via Bassini 15 - I-20133 Milano (Italy)
For more info : http://www.iasf-milano.inaf.it/~lucio/personal.html

Do not like Firefox =29 ?  Get Pale Moon !  http://www.palemoon.org

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-10 Thread Johan De Meersman
- Original Message -
 From: Lucio Chiappetti lu...@lambrate.inaf.it
 
 I may like a way to have a program (namely RSI IDL) to connect (bypassing
 the line mode mysql client) to the mysqld socket and issuing commands to
 it (essentially I want to issue a select into a table, and read back the
 output in an IDL structure) but I never managed to do it. But I did not
 try hard.

The unix socket, just like a tcp socket, is an appendage of the mysql daemon, 
and would thus require you to speak the mysql protocol. You can point the 
appropriate driver for your application to the socket file in roughly the same 
way as you point it to an ip/port combo (see the driver's documentation); or 
you can tell the commandline client to execute the query you want using the -e 
parameter, and optionally -b, -s or a number of others that modify the output 
format.

Sometimes the simplest things work best :-)


-- 
Unhappiness is discouraged and will be corrected with kitten pictures.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-10 Thread Reindl Harald



Am 10.03.2015 um 19:06 schrieb Lucio Chiappetti:

I guess all this very simple arrangements should cover the needs of the
OP as they do for me.


but that won't help as long the OP fires up blindly ssh-tunnel commands 
without understanding what a SSH tunnel and a TCP connection is and 
*that* is the whole problem of the thread from the frist start: missing 
basics and follow howtos not understanding what they are talking about




signature.asc
Description: OpenPGP digital signature


Re: ssh basics

2015-03-09 Thread Johan De Meersman

- Original Message -
 From: Thufir hawat.thu...@gmail.com
 Subject: Re: ssh basics
 
 Thank you for explaining that.

I can't quite tell wether you're being sarcastic or not, so I'm going to give 
you the benefit of the doubt :-)

Can you explain what you're trying to accomplish, without referencing sites 
you've found or things you've tried? I think I have a fair idea, but I'd like 
to hear it in your own words.


-- 
Unhappiness is discouraged and will be corrected with kitten pictures.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-09 Thread Johan De Meersman
- Original Message -
 From: Emil Oppeln-Bronikowski e...@fuse.pl
 Subject: Re: ssh basics

 Please, people, do we need that kind of thread?

Most action this list has seen since we had a thread about how little action 
this list sees... :-p


-- 
The idea that Bill Gates appeared like a knight in shining armour to lead all
customers out of a mire of technological chaos neatly ignores the fact that it
was he who, by peddling second-rate technology, led them into it in the first
place.

 - Douglas Adams in The Guardian, 25th August 1995

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-09 Thread Johan De Meersman
- Original Message -
 From: Thufir hawat.thu...@gmail.com
 Subject: Re: ssh basics
 
 I was being serious, I always appreciate a reply.  I know it was worded
 oddly, but, yes, just take it at face value, please.

Oh, I didn't see anything wrong with wording, but text doesn't convey a lot of 
inflexions :-p


 I read multiple suggestions to connect with that approach, the -L switch,
 none of the blogs/etc I saw explained why.  I suppose they assume that
 you know why already so don't say.  It's possible I overlooked the
 context, but I don't think so.

-L is local port forwarding; so -L localhost:3306:localhost:3306 will forward 
localhost:3306 on your machine (first two parameters) to localhost:3306 on the 
remote machine (second two parameters). Remote port forwarding with -R works 
the other way round.


 In and of itself, I'm fine with ssh into the host and then using the mysql
 console.  Since I'm not running scripts, it's moot whether the connection
 is through mysql directly, if that's the correct terminology, or just
 regular ssh.

From a security point of view it isn't moot, as the MySQL protocol is 
unencrypted unless you've set up SSL - but that's probably out of your scope 
atm.


 I'm interested in how ssh is used by MySQL.  While I have a pdf book on
 ssh, I don't, at the moment, have the time to just sit down and read it
 cover to cover.

SSH is not used by MySQL at all :-) SSH is a way of connecting to a remote 
machine. MySQL is a database. You can use SSH to do things with the database, 
but they're not intrinsically related.


 In the longer term, I'm considering whether or not to backup a small db,
 with cron, master/slave, or replicate it -- or something else.  I need to
 do some reading on that.  I've always done fine with just using mysqldump,
 but will probably need some additional tools to use.

Replication is not backup, it's high availability. Backup entails having 
multiple versions; or at the very least one copy that is not automatically 
updated with users errors from the primary system :-p


 Yes, I'm still figuring out the mechanics of ssh.  It was more of a ssh
 question than a MySQL question, fair enough, pardon about that, but was
 within the specific context of MySQL.

All in all, you've done the opposite of what I asked - you've told me what you 
know and tried, but not what you were trying to figure out with your original 
question :-p

Under the assumption that you wanted to use ssh to magically have a mysql 
prompt appear on your console:
* [ssh -t user@host mysql] will log in to your machine and start the mysql 
client. The -t tells SSH to allocate a pseudoterminal even though you specified 
a command to run.
* SSH keys (using ssh-agent or passwordless keys) will authenticate you against 
the remote OS, but NOT against the mysql auth system. You could use a .my.cnf 
file in your remote homedir for that; but that will have to hold the password 
in plaintext. Not particularly secure.
* [ssh -L 3307:localhost:3306 user@host] (3307 because you apparently had a 
local mysql on 3306 already) will forward as above, so you can do [mysql 
-hlocalhost -p3307] /on another terminal/ to connect to the remote mysql.

Personally I find the last one only useful if I want to use other things than 
the commandline on remote servers; but ymmv :-)

-- 
Unhappiness is discouraged and will be corrected with kitten pictures.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-09 Thread Thufir
On Mon, 09 Mar 2015 13:44:51 +0100, Johan De Meersman wrote:

 Thank you for explaining that.
 
 I can't quite tell wether you're being sarcastic or not, so I'm going to
 give you the benefit of the doubt
 
 Can you explain what you're trying to accomplish, without referencing
 sites you've found or things you've tried? I think I have a fair idea,
 but I'd like to hear it in your own words.


I was being serious, I always appreciate a reply.  I know it was worded 
oddly, but, yes, just take it at face value, please.

I read multiple suggestions to connect with that approach, the -L switch, 
none of the blogs/etc I saw explained why.  I suppose they assume that 
you know why already so don't say.  It's possible I overlooked the 
context, but I don't think so.

In and of itself, I'm fine with ssh into the host and then using the mysql 
console.  Since I'm not running scripts, it's moot whether the connection 
is through mysql directly, if that's the correct terminology, or just 
regular ssh.

I'm interested in how ssh is used by MySQL.  While I have a pdf book on 
ssh, I don't, at the moment, have the time to just sit down and read it 
cover to cover. 

In the longer term, I'm considering whether or not to backup a small db, 
with cron, master/slave, or replicate it -- or something else.  I need to 
do some reading on that.  I've always done fine with just using mysqldump, 
but will probably need some additional tools to use.

I can't really foresee much admin, many scripts to run against the db, 
but I suppose there's always something.

Yes, I'm still figuring out the mechanics of ssh.  It was more of a ssh 
question than a MySQL question, fair enough, pardon about that, but was 
within the specific context of MySQL.


-Thufir


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-08 Thread Thufir
On Sun, 08 Mar 2015 13:41:32 +0100, Reindl Harald wrote:

 What's the advantage?
 
 that you can have a local application using mysql by -h 127.0.0.1 which
 is a complete different thing than a interactive shell?


Thank you for explaining that.


-Thufir


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-08 Thread Thufir
On Sun, 08 Mar 2015 08:43:41 -0400, Ruben Safir wrote:


 gmail sucks


You prefer yahoo mail?  Just curious.


-Thufir


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-08 Thread Reindl Harald


Am 08.03.2015 um 02:38 schrieb Thufir:

how is this:

ssh -L 3305:localhost:3306 thufir@192.168.1.3

different from

ssh thufir@192.168.1.3

they seem functionally equivalent, neither gives me a MySQL console right
off the bat.  (I'm reading the man page and trying to understand bind
and the -L switch.)

I'd like to be able to use my ssh key to facilitate the login process;
for example, login remotely without a password, just using the key.


oh my god...
https://www.google.at/search?q=ssh+tunnel



signature.asc
Description: OpenPGP digital signature


Re: ssh basics

2015-03-08 Thread Emil Oppeln-Bronikowski
Please, people, do we need that kind of thread?

-- 
vag·a·bond adjective \ˈva-gə-ˌbänd\
 a :  of, relating to, or characteristic of a wanderer 
 b :  leading an unsettled, irresponsible, or disreputable life


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-08 Thread Ruben Safir
On Sun, Mar 08, 2015 at 08:03:05PM +, Thufir wrote:
 On Sun, 08 Mar 2015 08:43:41 -0400, Ruben Safir wrote:
 
 
  gmail sucks
 
 
 You prefer yahoo mail?  Just curious.
 

Your not curious.


 
 -Thufir
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql

-- 
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com 

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive 
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com 

Being so tracked is for FARM ANIMALS and and extermination camps, 
but incompatible with living as a free human being. -RI Safir 2013


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-08 Thread Ruben Safir
On Sun, Mar 08, 2015 at 12:20:10PM +, Thufir wrote:
 On Sun, 08 Mar 2015 10:47:17 +0100, Reindl Harald wrote:
 
 
  oh my god... https://www.google.at/search?q=ssh+tunnel
 


Yah know ssh and mysql wasn't invented 20 minutes ago.  They are basic
tools for GNU users for almost 2 decade so get off your ass and go look
this up, or ask the question in the porper location at least.

Or better, find a local user group, get off your damn cellphone, and get
some obviously much needed mentoring in GNU/Linux basics.


gmail sucks


 
 hmm, are you thinking that I'm not using ssh?  Because I'm using ssh 
 currently, and it works fine.  
 
 How is ssh -L 3305:localhost:3306 thufir@192.168.1.3  any better or more 
 useful than ssh thufir@192.168.1.3 ?
 
 
 The process described here:
 
 http://quintagroup.com/services/support/tutorials/mysql-linux
 
 doesn't seem demonstratively better, or even different, than just using 
 ssh to login, and then logging into MySQL.  However, I've seen that 
 approach mentioned quite a bit.
 
 What's the advantage?
 
 
 
 thanks,
 
 Thufir
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql

-- 
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com 

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive 
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com 

Being so tracked is for FARM ANIMALS and and extermination camps, 
but incompatible with living as a free human being. -RI Safir 2013


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-08 Thread Reindl Harald



Am 08.03.2015 um 13:20 schrieb Thufir:

On Sun, 08 Mar 2015 10:47:17 +0100, Reindl Harald wrote:


oh my god... https://www.google.at/search?q=ssh+tunnel



hmm, are you thinking that I'm not using ssh?  Because I'm using ssh
currently, and it works fine.


no, i am thinking you have no clue what a SSH tunnel nor a TCP 
connection are, otherwise this thread won't exist



How is ssh -L 3305:localhost:3306 thufir@192.168.1.3  any better or more
useful than ssh thufir@192.168.1.3 ?


boah the one is a ordinary SSH shell and the other is having the remote 
mysqld server listening on localhost



The process described here:

http://quintagroup.com/services/support/tutorials/mysql-linux

doesn't seem demonstratively better, or even different, than just using
ssh to login, and then logging into MySQL.  However, I've seen that
approach mentioned quite a bit.

What's the advantage?


that you can have a local application using mysql by -h 127.0.0.1 which 
is a complete different thing than a interactive shell?




signature.asc
Description: OpenPGP digital signature


Re: ssh basics

2015-03-08 Thread Thufir
On Sun, 08 Mar 2015 10:47:17 +0100, Reindl Harald wrote:


 oh my god... https://www.google.at/search?q=ssh+tunnel


hmm, are you thinking that I'm not using ssh?  Because I'm using ssh 
currently, and it works fine.  

How is ssh -L 3305:localhost:3306 thufir@192.168.1.3  any better or more 
useful than ssh thufir@192.168.1.3 ?


The process described here:

http://quintagroup.com/services/support/tutorials/mysql-linux

doesn't seem demonstratively better, or even different, than just using 
ssh to login, and then logging into MySQL.  However, I've seen that 
approach mentioned quite a bit.

What's the advantage?



thanks,

Thufir


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-07 Thread Thufir
On Sun, 08 Mar 2015 00:20:26 +, Thufir wrote:


 I mean, I can ssh into tleilax and then fire up the MySQL console.  Is
 there a better approach?




This just hangs:

thufir@doge:~$ 
thufir@doge:~$ mysql -u cron -h 192.168.1.3 -p
Enter password: 


^C
thufir@doge:~$ 


because, I think, I disabled password based authentication (as I recall, 
I haven't been on the system in a bit).  In any event, it's good that it 
hangs.  MySQL log:


150223  7:35:24 [Note] /usr/sbin/mysqld: Shutdown complete

150223 07:35:24 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid 
ended
150307 18:38:27 mysqld_safe Starting mysqld daemon with databases from /
var/lib/mysql
150307 18:38:32 [Warning] The syntax '--log-slow-queries' is deprecated 
and will be removed in a future release. Please use '--slow-query-log'/'--
slow-query-log-file' instead.
150307 18:38:33 [Warning] Using unique option prefix myisam_recover 
instead of myisam-recover-options is deprecated and will be removed in a 
future release. Please use the full name instead.
150307 18:38:33 InnoDB: The InnoDB memory heap is disabled
150307 18:38:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150307 18:38:33 InnoDB: Compressed tables use zlib 1.2.8
150307 18:38:33 InnoDB: Using Linux native AIO
150307 18:38:33 InnoDB: Initializing buffer pool, size = 128.0M
150307 18:38:33 InnoDB: Completed initialization of buffer pool
150307 18:38:33 InnoDB: highest supported file format is Barracuda.
150307 18:38:33  InnoDB: Waiting for the background threads to start
150307 18:38:34 Percona XtraDB (http://www.percona.com) 5.5.33-
MariaDB-31.1 started; log sequence number 1597945
150307 18:38:34 [Note] Server socket created on IP: '0.0.0.0'.
150307 18:38:34 [Warning] 'user' entry 'root@linux-k7qk' ignored in --
skip-name-resolve mode.
150307 18:38:34 [Warning] 'user' entry '@linux-k7qk' ignored in --skip-
name-resolve mode.
150307 18:38:34 [Warning] 'proxies_priv' entry '@ root@linux-k7qk' 
ignored in --skip-name-resolve mode.
150307 18:38:34 [Note] Event Scheduler: Loaded 0 events
150307 18:38:34 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.33-MariaDB-log'  socket: '/var/run/mysql/mysql.sock'  port: 
3306  openSUSE package
thufir@tleilax:~ 
thufir@tleilax:~ 




thanks,

Thufir


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: ssh basics

2015-03-07 Thread Reindl Harald



Am 08.03.2015 um 01:20 schrieb Thufir:

I want to ssh into Mysql, something like:

thufir@doge:~$
thufir@doge:~$ ssh -L 3306:localhost:3306 thufir@192.168.1.3
bind: Address already in use


that is a pretty clear message

you can't use port 3306 if you have running a mysqld on both machines, 
so just use a different local port




signature.asc
Description: OpenPGP digital signature


Re: ssh basics

2015-03-07 Thread Thufir
On Sun, 08 Mar 2015 01:30:46 +0100, Reindl Harald wrote:

 Am 08.03.2015 um 01:20 schrieb Thufir:
 I want to ssh into Mysql, something like:

 thufir@doge:~$
 thufir@doge:~$ ssh -L 3306:localhost:3306 thufir@192.168.1.3 bind:
 Address already in use
 
 that is a pretty clear message
 
 you can't use port 3306 if you have running a mysqld on both machines,
 so just use a different local port



Thanks.

how is this:

ssh -L 3305:localhost:3306 thufir@192.168.1.3

different from

ssh thufir@192.168.1.3

they seem functionally equivalent, neither gives me a MySQL console right 
off the bat.  (I'm reading the man page and trying to understand bind 
and the -L switch.)


I'd like to be able to use my ssh key to facilitate the login process; 
for example, login remotely without a password, just using the key.



thanks,

Thufir


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql