Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Instead of downgrade MySQL gem, it's possible to fix the database name parameter to fix the <code>"bad handshake"</code> problem.</p> <p>I found this: <a href="https://github.com/rubygems/rubygems/issues/423" rel="noreferrer">https://github.com/rubygems/rubygems/issues/423</a> It's working good.</p> <p>Instead of doing a hack in <code>real_connect</code> it's possible to add the <code>"\0"</code> in <code>config/database.yml</code></p> <pre><code>production: database: "itsalive_production\0" adapter: mysql host: localhost encoding: UTF8 ... </code></pre> <p>EDIT<br> If you use the solution with <code>\0</code> at the end of the database name. You probably will find find out this and solve it yourself, but I mention it anyway:<br> (<em>at least in my version of Rails</em>)<br> Using the database string with <code>\0</code> at the end gives problem when doing <code>rake test</code>. It starts with deleting the test database before copying the development database definitions, and then using a SQL command string that includes the test database name. This will cause an <strong>error</strong> because of the <code>\0</code> in the middle of the string.</p> <p>In my case I'm using a local development database that doesn't give any problem so I don't need to have <code>\0</code> in that name.<br> Here is a alternative hack to solve that (original code in <code>mysql_adapter.rb</code>):</p> <pre><code>module ActiveRecord module ConnectionAdapters class MysqlAdapter alias_method :old_execute, :execute def execute(sql, name = nil) #:nodoc: # This is needed because database names can end with "\0" to fix # the issue with "handshake" when mysql server is newer than the gem # requires. E.g. called when loading the new test db when doing "rake test". sql = sql.delete("\0") old_execute(sql, name) end end end end </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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