耙中止!未初始化的常量 Mysql2

rake aborted! uninitialized constant Mysql2(耙中止!未初始化的常量 Mysql2)
本文介绍了耙中止!未初始化的常量 Mysql2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Goksel-Eryigits-Mac-mini:blog geryit$ rake db:migrate --trace
(in /Users/geryit/Sites/blog)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
Client does not support authentication protocol requested by server; consider upgrading MySQL client
/Users/geryit/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/mysql.rb:453:in `read'
/Users/geryit/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/mysql.rb:130:in `real_connect'
/Users/geryit/.rvm/gems/ruby-1.8.7-p330/gems/activerecord-3.0.3/lib/active_record/connection_adapters/mysql_adapter.rb:600:in `connect'
/Users/geryit/.rvm/gems/ruby-1.8.7-p330/gems/activerecord-3.0.3/lib/active_record/connection_adapters/mysql_adapter.rb:164:in `initialize
.
.
.

数据库.yml

development:
  adapter: mysql
  encoding: utf8
  database: test
  pool: 5
  username: root
  password:
  socket: /tmp/mysql.sock

推荐答案

他们现在一起工作没有任何问题.问题是 Mysql 版本和 mysql gem 标志.我删除了 MYSQL 5.5 并重新安装了 Mysql 5.1.一切都是固定的.谢谢.

They work together now without any problems. The problem was Mysql version and mysql gem flags. I removed MYSQL 5.5 and installed Mysql 5.1 back. Everything is fixed. Thanks.

我写了一篇关于安装的博客文章,它可能会有所帮助:https://geryit.com/blog/installing-mysql-with-rails-on-mac-os-x-snow-leopard/

I wrote a blog post about installing, it can be helpful : https://geryit.com/blog/installing-mysql-with-rails-on-mac-os-x-snow-leopard/

这篇关于耙中止!未初始化的常量 Mysql2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

LazyInitializationException trying to get lazy initialized instance(LazyInitializationException 试图获取惰性初始化实例)
xampp mysql Failed to initialize multi master structures(xampp mysql无法初始化多主结构)
Initialize MariaDB 10.4.12 on CentOS 7.7(在 CentOS 7.7 上初始化 MariaDB 10.4.12)
How can I initialize a MySQL database with schema in a Docker container?(如何在 Docker 容器中使用架构初始化 MySQL 数据库?)
Initializing a MySQL database deployed in an AWS EKS(初始化部署在 AWS EKS 中的 MySQL 数据库)
How to resolve ORA-011033: ORACLE initialization or shutdown in progress(如何解决 ORA-011033:正在进行 ORACLE 初始化或关闭)