Creating tables and problems with primary key in Rails

I had a same problem before, and I solved according to here https://github.com/rails/rails/pull/13247#issuecomment-32425844 With Rails 2.3.5, MySQL version 5.7.9 and mysql gem you need to have this bit as an initializer in config/initializers/abstract_mysql_adapter.rb: class ActiveRecord::ConnectionAdapters::MysqlAdapter NATIVE_DATABASE_TYPES[:primary_key] = “int(11) auto_increment PRIMARY KEY” end For mysql2, it should be config/initializers/abstract_mysql2_adapter.rb: class ActiveRecord::ConnectionAdapters::Mysql2Adapter NATIVE_DATABASE_TYPES[:primary_key] = “int(11) auto_increment PRIMARY … Read more

Mysql 5.6 headaches on Mac OSX

None of the answers here helped me, but finally I got MySQL 5.6 to work. THREE options to fix MySQL 5.6: (confirmed) Edit /etc/my.cnf (create if not exists) and add: [mysqld] innodb_file_per_table = OFF and restart MySQL. Then for this to work you’ll need to dump your databases into SQL file (mysqldump), then drop and … Read more

mysql2 gem compiled for wrong mysql client library

Uninstalling and reinstalling the gem will often solve this issue with no need to download and move files around by hand. From your rails app directory: > gem uninstall mysql2 You have requested to uninstall the gem: mysql2-0.3.11 database_cleaner-0.9.1 depends on [mysql2 (>= 0)] If you remove this gems, one or more dependencies will not … Read more

Ruby gem mysql2 install failing [duplicate]

Ubuntu: sudo apt-get install libmysqlclient-dev #(mysql development headers) sudo gem install mysql2 — –with-mysql-dir=/etc/mysql/ That’s it! Result: Building native extensions. This could take a while… Successfully installed mysql2-0.2.6 1 gem installed Installing ri documentation for mysql2-0.2.6… Enclosing class/module ‘mMysql2’ for class Result not known Enclosing class/module ‘mMysql2’ for class Client not known Installing RDoc documentation … Read more

Error when trying to install app with mysql2 gem

For anybody still experiencing the issue: When you install openssl via brew, you should get the following message: Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries Generally there are no consequences of this for you. If you build your own software and it requires this formula, you’ll need … Read more