TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Script to (1) log into remote box, (2) connect to MySQL db

1 pointsby jdolitskyover 12 years ago

1 comment

lutuspover 12 years ago
What's the point of all this complexity? Since the system already has and uses SSH, why not do it in one line?<p><pre><code> # ssh hostname "echo 'use db; show tables' | mysql -p(password)" </code></pre> Or, for a remote, interactive MySQL session that prompts for a password:<p><pre><code> # ssh -t hostname mysql -p </code></pre> The linked content is overkill.