Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I was able to track down the problem. I started by connecting to the host using the MySQL command from my development machine using the command <code>mysql --host=<em>ip</em> --user=<em>user</em> --password=<em>password</em> <em>db</em></code>. This was very slow, so I ssh'ed into the server, and connected from there using the same command. This was also slow.</p> <p>I changed the command to <code>mysql --host=<strong>localhost</strong> --user=<em>user</em> --password=<em>password</em> <em>db</em></code> and I was able to connect instantaneously. I added an entry for my development system in the <code>/etc/hosts</code> file, and was able to connect instantaneously from that as well. Apparently the MySQL server was attempting to perform a reverse dns lookup to resolve the host name associated with the IP address, as is listed in the <a href="http://dev.mysql.com/doc/refman/5.0/en/dns.html" rel="nofollow noreferrer">MySQL Manual</a>, and was timing out.</p> <p>I added the <code>--skip-name-resolve</code> option to the start section of the /etc/init.d/mysql script, so that this check is skipped, and restarted the server. When I run the profile script I created earlier, I get the following result:</p> <pre><code>Server version: 5.0.32-Debian_7etch3-log Server version: 5.0.32-Debian_7etch3-log Server version: 5.0.32-Debian_7etch3-log Server version: 5.0.32-Debian_7etch3-log Server version: 5.0.32-Debian_7etch3-log Thread ID: 52978590 Total: 0.016000 %self total self wait child calls name 87.50 0.01 0.01 0.00 0.00 5 &lt;Class::Mysql&gt;#real_connect (ruby_runtime:0} 6.25 0.00 0.00 0.00 0.00 10 IO#write (ruby_runtime:0} 6.25 0.00 0.00 0.00 0.00 5 Mysql#close (ruby_runtime:0} 0.00 0.00 0.00 0.00 0.00 5 Kernel#puts (ruby_runtime:0} 0.00 0.00 0.00 0.00 0.00 5 Mysql#initialize (ruby_runtime:0} 0.00 0.00 0.00 0.00 0.00 5 String#+ (ruby_runtime:0} 0.00 0.02 0.00 0.00 0.02 1 Global#[No method] (tmp/mysql_test/test.rb:12} 0.00 0.02 0.00 0.00 0.02 1 Integer#times (ruby_runtime:0} 0.00 0.00 0.00 0.00 0.00 5 Mysql#get_server_info (ruby_runtime:0} </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload