<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>42</title>
	<atom:link href="http://www.42.mach7x.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.42.mach7x.com</link>
	<description>Thoughts and tips about programming with Ruby on Rails</description>
	<lastBuildDate>Wed, 09 May 2012 09:15:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Using Postfix to send out emails from development environment in Rails</title>
		<link>http://www.42.mach7x.com/2012/05/09/using-postfix-to-send-out-emails-from-development-environment-in-rails/</link>
		<comments>http://www.42.mach7x.com/2012/05/09/using-postfix-to-send-out-emails-from-development-environment-in-rails/#comments</comments>
		<pubDate>Wed, 09 May 2012 09:12:54 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[Ubuntu/Debian]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=524</guid>
		<description><![CDATA[Problem You want to be able to send emails from your development enironment using Postfix in your (K)Ubuntu pc. Solution First you would need to install postfix: sudo apt-get install postfix and then you would need to change an option &#8230; <a href="http://www.42.mach7x.com/2012/05/09/using-postfix-to-send-out-emails-from-development-environment-in-rails/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>You want to be able to send emails from your development enironment using Postfix in your (K)Ubuntu pc.</p>
<p><strong>Solution</strong></p>
<p>First you would need to install postfix:</p>
<pre class="brush:shell">sudo apt-get install postfix</pre>
<p>and then you would need to change an option in postfix to not use tls, so change /etc/postfix/main.cf:</p>
<pre class="brush:shell">sudo vi /etc/postfix/main.cf</pre>
<p>and change the smtpd_use_tls from yes to no:</p>
<pre class="brush:shell">smtpd_use_tls=no</pre>
<p>restart your postfix server:</p>
<pre class="brush:shell">sudo /usr/sbin/postfix reload</pre>
<p>and then setup your config/development.rb as follows:</p>
<pre class="brush:shell">config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  address:                 "127.0.0.1",
  port:                    25,
  enable_starttls_auto:    false
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2012/05/09/using-postfix-to-send-out-emails-from-development-environment-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Command line mail message with postfix in (K)ubuntu</title>
		<link>http://www.42.mach7x.com/2012/05/08/command-line-mail-message-with-postfix-in-kubuntu/</link>
		<comments>http://www.42.mach7x.com/2012/05/08/command-line-mail-message-with-postfix-in-kubuntu/#comments</comments>
		<pubDate>Tue, 08 May 2012 15:36:42 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Ubuntu/Debian]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=520</guid>
		<description><![CDATA[Problem You have installed postfix in your local development machine (sudo apt-get install postfix), and you want to test sending emails from the command line using mail email_address@someone.com &#160; Solution You would first need to install the mailutils package: sudo &#8230; <a href="http://www.42.mach7x.com/2012/05/08/command-line-mail-message-with-postfix-in-kubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>You have installed postfix in your local development machine (sudo apt-get install postfix), and you want to test sending emails from the command line using mail email_address@someone.com</p>
<p>&nbsp;</p>
<p><strong>Solution</strong></p>
<p>You would first need to install the mailutils package:</p>
<pre class="brush:shell">
sudo apt-get install mailutils
</pre>
<p>then you can send an email by:</p>
<pre class="brush:shell">
mail email_name@example.com
CC: (leave blank)
Subject: Test subject
Main message body
</pre>
<p>and you can send it by pressing Ctrl+D</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2012/05/08/command-line-mail-message-with-postfix-in-kubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redirecting postfix email to a different email account</title>
		<link>http://www.42.mach7x.com/2012/04/23/redirecting-postfix-email-to-a-different-email-account/</link>
		<comments>http://www.42.mach7x.com/2012/04/23/redirecting-postfix-email-to-a-different-email-account/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 08:16:31 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[email redirection]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=515</guid>
		<description><![CDATA[Problem You have setup your Rails app to send out emails using postfix, but you also want to redirect the incoming emais to a different account. Solution Edit the postfix configuration file vi /etc/postfix/main.cf and add the following two lines &#8230; <a href="http://www.42.mach7x.com/2012/04/23/redirecting-postfix-email-to-a-different-email-account/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>You have setup your Rails app to send out emails using postfix, but you also want to redirect the incoming emais to a different account.</p>
<p><strong>Solution</strong></p>
<p>Edit the postfix configuration file vi /etc/postfix/main.cf and add the following two lines at the bottom:</p>
<pre class="brush:shell">
virtual_alias_domains = outgoing_domain.com
virtual_alias_maps = hash:/etc/postfix/virtual
</pre>
<p>And then add the redirections to the virtual file with vi /etc/postfix/virtual:</p>
<pre class="brush:shell">
outgoing_email@outgoing_domain.com           other_account@other_domain.com
@outgoing_domain.com                         other_account@other_domain.com
</pre>
<p>Then run the following two commands to restart postfix:</p>
<pre class="brush:shell">
postmap /etc/postfix/virtual
postfix reload
</pre>
<p>* Based on the post <a href="http://www.cyberciti.biz/faq/linux-unix-bsd-postfix-forward-email-to-another-account/" title="here">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2012/04/23/redirecting-postfix-email-to-a-different-email-account/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Having both the www and without domain names in Apache</title>
		<link>http://www.42.mach7x.com/2012/04/19/having-both-the-www-and-without-domain-names-in-apache/</link>
		<comments>http://www.42.mach7x.com/2012/04/19/having-both-the-www-and-without-domain-names-in-apache/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 13:49:47 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[vhost]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=513</guid>
		<description><![CDATA[Problem You would like to have both www.domain.name and domain.name server by Apache. &#160; Solution In your vhost configuration add the following two lines: ServerName www.domain.name ServerAlias domain.name &#160;]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>You would like to have both www.domain.name and domain.name server by Apache.</p>
<p>&nbsp;</p>
<p><strong>Solution</strong></p>
<p>In your vhost configuration add the following two lines:</p>
<p>ServerName www.domain.name<br />
ServerAlias domain.name<br />
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2012/04/19/having-both-the-www-and-without-domain-names-in-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting console in staging or production environment</title>
		<link>http://www.42.mach7x.com/2012/04/16/starting-console-in-staging-or-production-environment/</link>
		<comments>http://www.42.mach7x.com/2012/04/16/starting-console-in-staging-or-production-environment/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 14:28:36 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[production]]></category>
		<category><![CDATA[Rails 3]]></category>
		<category><![CDATA[Staging]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=509</guid>
		<description><![CDATA[Problem You would like to start your rails console in an environment that is not the development, like staging or production. &#160; Solution Using the latest 3 shortcut you can use: rails c staging]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>You would like to start your rails console in an environment that is not the development, like staging or production.</p>
<p>&nbsp;</p>
<p><strong>Solution</strong></p>
<p>Using the latest 3 shortcut you can use:</p>
<p>rails c staging</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2012/04/16/starting-console-in-staging-or-production-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Could not find activesupport-3.0.12 in any of the sources (Bundler::GemNotFound)</title>
		<link>http://www.42.mach7x.com/2012/03/19/could-not-find-activesupport-3-0-12-in-any-of-the-sources-bundlergemnotfound/</link>
		<comments>http://www.42.mach7x.com/2012/03/19/could-not-find-activesupport-3-0-12-in-any-of-the-sources-bundlergemnotfound/#comments</comments>
		<pubDate>Mon, 19 Mar 2012 12:52:08 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Phusion Passenger]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[Passenger]]></category>
		<category><![CDATA[ruby 1.9.3]]></category>
		<category><![CDATA[rvm]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=500</guid>
		<description><![CDATA[Problem You are trying to update your rails app deployed on a server, for example from 3.0.11 to 3.0.12, and at the same time trying to update the Ruby version from 1.9.2 to 1.9.3 but you are getting the following &#8230; <a href="http://www.42.mach7x.com/2012/03/19/could-not-find-activesupport-3-0-12-in-any-of-the-sources-bundlergemnotfound/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>You are trying to update your rails app deployed on a server, for example from 3.0.11 to 3.0.12, and at the same time trying to update the Ruby version from 1.9.2 to 1.9.3 but you are getting the following error from passenger:</p>
<pre class="brush:shell">    Could not find activesupport-3.0.12 in any of the sources (Bundler::GemNotFound)

<strong>Solution</strong>

You would need to reinstall and compile the passenger module with the newest Ruby 1.9.3 installation.
</pre>
<pre class="brush:shell">gem install passenger

passenger-install-apache2-module</pre>
<p>and then modify the apache configuration file as in:</p>
<pre class="brush:shell">The Apache 2 module was successfully installed.                   

Please edit your Apache configuration file, and add these lines:

   LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p125/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
   PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p125/gems/passenger-3.0.11
   PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-p125/ruby

After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!</pre>
<p>and then reload your apache configuration</p>
<pre class="brush:shell">sudo /etc/init.di/apache2 reload</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2012/03/19/could-not-find-activesupport-3-0-12-in-any-of-the-sources-bundlergemnotfound/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Vagrant Box with Debian Lenny 32, rvm and Ruby 1.9.3</title>
		<link>http://www.42.mach7x.com/2012/03/16/creating-a-vagrant-box-with-debian-lenny-32-rvm-and-ruby-1-9-3/</link>
		<comments>http://www.42.mach7x.com/2012/03/16/creating-a-vagrant-box-with-debian-lenny-32-rvm-and-ruby-1-9-3/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 14:37:03 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Ubuntu/Debian]]></category>
		<category><![CDATA[Vagrant]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[ruby 1.9.3]]></category>
		<category><![CDATA[rvm]]></category>
		<category><![CDATA[vagrant]]></category>
		<category><![CDATA[VM]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=498</guid>
		<description><![CDATA[As an addition to the excellent beta book &#8216;Deploying Rails&#8217;, as I had problems using the suggested lucid64 image, I&#8217;ve tried to install a debian lenny 32 image with rvm and Ruby 1.9.3. The steps needed are listed below &#160; &#8230; <a href="http://www.42.mach7x.com/2012/03/16/creating-a-vagrant-box-with-debian-lenny-32-rvm-and-ruby-1-9-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As an addition to the excellent beta book &#8216;Deploying Rails&#8217;, as I had problems using the suggested lucid64 image, I&#8217;ve tried to install a debian lenny 32 image with rvm and Ruby 1.9.3.</p>
<p>The steps needed are listed below</p>
<p>&nbsp;</p>
<ol>
<li>Download the lenny package:
<pre class="brush:shell">vagrant box add debian-lenny-32 https://s3-eu-west-1.amazonaws.com/glassesdirect-boxen/debian/debian_lenny_32.box</pre>
</li>
<li>Make a new directory for the virtual box:
<pre class="brush:shell">$ mkdir -p ~/deployingrails/lenny32</pre>
</li>
<li>change into created directory and create the Vagrant file:
<pre class="brush:shell">cd ~/deployingrails/lenny32
vagrant init</pre>
</li>
<li>change the Vagrant file to use the virtual box we have downloaded:
<pre class="brush:shell">Vagrant::Config.run do |config|
  config.vm.box = "lenny32"
end</pre>
</li>
<li>Start the VM:
<pre class="brush:shell">vagrant up</pre>
</li>
<li>If there is a warning about the Guest additions here install the latest guest additions by following the description here http://www.virtualbox.org/manual/ch04.html, but only use the update and upgrade steps as:
<pre class="brush:shell">sudo apt-get update
sudo apt-get upgrade</pre>
</li>
<li>After finishing the upgrade logout (exit) from the VM and issue the command to restart the VM:
<pre class="brush:shell">vagrant reload</pre>
</li>
<li>login to the VM again:
<pre class="brush:shell">vagrant ssh</pre>
</li>
<li>
<pre class="brush:shell">Install curl to be able to download the installation script for:</pre>
<pre class="brush:shell">sudo apt-get install curl</pre>
</li>
<li>Download and install rvmÂ  by using the script described here http://beginrescueend.com/rvm/install/ :
<pre class="brush:shell">$ bash -s stable &lt; &lt;(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)</pre>
</li>
<li>Add the following to ~/.bashrc:
<pre class="brush:shell">user$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] &amp;&amp; . "$HOME/.rvm/scripts/rvm" # Load RVM function' &gt;&gt; ~/.bashrc</pre>
</li>
<li>Reload the bashrc file:
<pre class="brush:shell">source ~/.bashrc</pre>
</li>
<li>Make sure that the rvm is loaded as function:
<pre class="brush:shell">vagrant$ type rvm | head -1
rvm is a function</pre>
</li>
<li>Run the rvm requirement to see the needed libraries and then run the suggested ones (except libreadline6 and libreadline6-dev that are not there in debian):
<pre class="brush:shell">sudo apt-get install build-essential openssl curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison</pre>
</li>
<li>Install Ruby 1.9.3 :
<pre class="brush:shell">rvm install ruby-1.9.3</pre>
</li>
<li>Use the ruby 1.9.3 as default:
<pre class="brush:shell">rvm use 1.9.3 --default</pre>
</li>
<li>Finally create a new VM package to use in future:
<pre class="brush:shell">vagrant package --output lenny32-rvm-ruby193</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2012/03/16/creating-a-vagrant-box-with-debian-lenny-32-rvm-and-ruby-1-9-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cannot load such file &#8212; zlib</title>
		<link>http://www.42.mach7x.com/2012/03/03/cannot-load-such-file-zlib/</link>
		<comments>http://www.42.mach7x.com/2012/03/03/cannot-load-such-file-zlib/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 12:38:08 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[rvm]]></category>
		<category><![CDATA[zlib]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=495</guid>
		<description><![CDATA[Problemo You are trying to install a gem with rvm but you are getting the following error: ERROR: Loading command: install (LoadError cannot load such file &#8212; zlib ERROR: While executing gem &#8230; (NameError) uninitialized constant Gem::Commands::InstallCommand Solution Following from &#8230; <a href="http://www.42.mach7x.com/2012/03/03/cannot-load-such-file-zlib/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Problemo<br />
</strong></p>
<p>You are trying to install a gem with rvm but you are getting the following error:</p>
<p>ERROR: Loading command: install (LoadError<br />
cannot load such file &#8212; zlib<br />
ERROR: While executing gem &#8230; (NameError)<br />
uninitialized constant Gem::Commands::InstallCommand</p>
<p><strong>Solution</strong></p>
<p>Following from the post <a href="http://stackoverflow.com/questions/769496/ubuntu-noob-rails-install-fails-on-zlib&quot;">here</a></p>
<p>you would need to install the zlib library with rvm, uninstall your ruby version and then install the ruby version again with the folowing:</p>
<p>&nbsp;</p>
<pre class="brush:applescript">rvm pkg install zlib

rvm uninstall 1.9.3

rvm install 1.9.3</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2012/03/03/cannot-load-such-file-zlib/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a record in Rails through javascript</title>
		<link>http://www.42.mach7x.com/2012/02/27/adding-a-record-in-rails-through-javascript/</link>
		<comments>http://www.42.mach7x.com/2012/02/27/adding-a-record-in-rails-through-javascript/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 09:32:38 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=492</guid>
		<description><![CDATA[Problem You would like to trigger a record insertion after a specific action has happened through javascript (ie drag &#8211; drop an item into a container), in a rails application. &#160; Solution You would need to get the object attributes &#8230; <a href="http://www.42.mach7x.com/2012/02/27/adding-a-record-in-rails-through-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>You would like to trigger a record insertion after a specific action has happened through javascript (ie drag &#8211; drop an item into a container), in a rails application.</p>
<p>&nbsp;</p>
<p><strong>Solution</strong></p>
<p><strong></strong>You would need to get the object attributes from the html page somehow (ie user_id and user_name), and then have a function in your application js that calls the post function.</p>
<p>So if you have a drag and drop container for example then the code in the application.js should be like the following:</p>
<pre class="brush:js">$("#name_of_container").droppable({
  drop: handleDropEvent
});

function handleDropEvent(event,ui) {
  var user_id = ui.draggable.attr("user_id");
  var user_name = ui.draggable.attr("user_name");
  $.post('/users', {user: {user_id: user_id, name: user_name}})
}</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2012/02/27/adding-a-record-in-rails-through-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connect to a remote MySQL server with MySQLBrowser using SSH</title>
		<link>http://www.42.mach7x.com/2012/02/24/connect-to-a-remote-mysql-server-with-mysqlbrowser-using-ssh/</link>
		<comments>http://www.42.mach7x.com/2012/02/24/connect-to-a-remote-mysql-server-with-mysqlbrowser-using-ssh/#comments</comments>
		<pubDate>Fri, 24 Feb 2012 09:49:17 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Mysql-query-browser]]></category>
		<category><![CDATA[port forwarding]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=488</guid>
		<description><![CDATA[Problem You would like to connect to a remote MySQL server using the Mysql-query-browser GUI tool, and you only have localhost access to the remote server, but also have ssh access to the remote server. &#160; Solution You can use &#8230; <a href="http://www.42.mach7x.com/2012/02/24/connect-to-a-remote-mysql-server-with-mysqlbrowser-using-ssh/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>You would like to connect to a remote MySQL server using the Mysql-query-browser GUI tool, and you only have localhost access to the remote server, but also have ssh access to the remote server.</p>
<p>&nbsp;</p>
<p><strong>Solution</strong></p>
<p>You can use the following command to start a port forwarding to your localhost and then use that to connect to the remote database server:</p>
<pre class="brush:shell">ssh -L 3307:localhost:3306 user_name@remote_host -N</pre>
<p>You could then use the following to the Mysql-query-broser connection:</p>
<p>&nbsp;</p>
<pre class="brush:shell">Hostname: 127.0.0.1
username: db_user_name_on_remote
password: db_user_password_on_remote
port: 3307</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2012/02/24/connect-to-a-remote-mysql-server-with-mysqlbrowser-using-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

