# Mysql

**URL:** <https://www.ruby-forum.com/t/mysql/175946>\
**Category:** Rails\
**Created:** [September 23, 2009, 1:52am UTC](https://www.ruby-forum.com/t/mysql/175946 "2009-09-23T01:52:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![agnathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@agnathan](https://www.ruby-forum.com/u/agnathan)\
**Post date:** [September 23, 2009, 1:52am UTC](https://www.ruby-forum.com/t/mysql/175946/1 "2009-09-23T01:52:08Z")

</div>

hi  
im on ubuntu 8.0r lts, installed rails 2.3.4 ruby gem 1.3.5 mysql  
5.0

when i rails myapp =\>creates an sqllite3 environment and works good  
when i rails myapp -d mysql have an error when run db:create

Couldn’t create database for {“socket”=\>"/var/run/mysqld/mysqld.sock",  
“reconnect”=\>false, “encoding”=\>“utf8”, “username”=\>“root”,  
“adapter”=\>“mysql”, “password”=\>“difahu”, “database”=\>“a4\_development”,  
“pool”=\>5}, charset: utf8, collation: utf8\_unicode\_ci (if you set the  
charset manually, make sure you have a matching collation)

i can access mysql , irb, individually without problem

somebody knows what happens???

---

<div class="post-metadata">

**Author:** ![agnathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@agnathan](https://www.ruby-forum.com/u/agnathan)\
**Post date:** [September 23, 2009, 5:15am UTC](https://www.ruby-forum.com/t/mysql/175946/2 "2009-09-23T05:15:10Z")

</div>

I have seen the fix for this be one of the following:

if you have charset: utf8 change that to encoding  
or use 127.0.0.1 and not localhost  
or permissions for the user in the database (create table is a good  
one to have… )

On Sep 22, 4:52 pm, Daniel Hutchinson \<rails-mailing-l…@andreas-

---

<div class="post-metadata">

**Author:** ![agnathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@agnathan](https://www.ruby-forum.com/u/agnathan)\
**Post date:** [September 23, 2009, 4:40pm UTC](https://www.ruby-forum.com/t/mysql/175946/3 "2009-09-23T16:40:29Z")

</div>

heimdull wrote:

> I have seen the fix for this be one of the following:
> 
> if you have charset: utf8 change that to encoding  
> or use 127.0.0.1 and not localhost  
> or permissions for the user in the database (create table is a good  
> one to have… )
> 
> On Sep 22, 4:52ï¿½pm, Daniel Hutchinson \<rails-mailing-l…@andreas-

Thanks a lot! heimdull for the answer . Im a beginner i RoR and I come  
from Visual Fox-\>SQL platform .

I tried as you said. And I get the next line messages (above)

if you see ( and I did not) the service start at 0.0.0.0:3000  
and another line I didnt see either is

“Client does not support authentication protocol requested by server;  
consider upgrading MySQL client”

So if you or another can make me easy the way thanks, I will looking  
for now with this data something more

Thanks Again for your help

## -----------------------LINE MESSAGES

dhd@dhd-desktop:~/a4$ script/server  
=\> Booting Mongrel  
=\> Rails 2.3.4 application starting on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
=\> Call with -d to detach  
=\> Ctrl-C to shutdown server  
/!\ FAILSAFE /!\ Wed Sep 23 09:33:50 -0500 2009  
Status: 500 Internal Server Error  
Client does not support authentication protocol requested by server;  
consider upgrading MySQL client  
/usr/lib/ruby/1.8/mysql.rb:453:in `read' /usr/lib/ruby/1.8/mysql.rb:130:in `real\_connect’  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active\_record/connection\_adapters/mysql\_adapter.rb:585:in  
`connect' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:199:in `initialize’  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active\_record/connection\_adapters/mysql\_adapter.rb:71:in  
`new' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:71:in `mysql\_connection’  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active\_record/connection\_adapters/abstract/connection\_pool.rb:223:in  
`send' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new\_connection’  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active\_record/connection\_adapters/abstract/connection\_pool.rb:245:in  
`checkout_new_connection' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout’  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active\_record/connection\_adapters/abstract/connection\_pool.rb:184:in  
`loop' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout’  
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout’  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active\_record/connection\_adapters/abstract/connection\_pool.rb:98:in  
`connection' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve\_connection’  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:123:in  
`retrieve_connection' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection’  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active\_record/query\_cache.rb:9:in  
`cache' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/query_cache.rb:28:in `call’  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active\_record/connection\_adapters/abstract/connection\_pool.rb:361:in  
`call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/head.rb:9:in `call’  
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/methodoverride.rb:24:in  
`call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/params_parser.rb:15:in `call’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action\_controller/session/cookie\_store.rb:93:in  
`call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/failsafe.rb:26:in `call’  
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `synchronize’  
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:114:in `call’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action\_controller/reloader.rb:34:in  
`run' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:108:in `call’  
/usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/rack/static.rb:31:in  
`call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:46:in `call’  
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in  
`each' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in `call’  
/usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/rack/log\_tailer.rb:17:in  
`call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:13:in `call’  
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/chunked.rb:15:in  
`call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:61:in `process’  
/usr/lib/ruby/1.8/mongrel.rb:159:in `process_client' /usr/lib/ruby/1.8/mongrel.rb:158:in `each’  
/usr/lib/ruby/1.8/mongrel.rb:158:in `process_client' /usr/lib/ruby/1.8/mongrel.rb:285:in `run’  
/usr/lib/ruby/1.8/mongrel.rb:285:in `initialize' /usr/lib/ruby/1.8/mongrel.rb:285:in `new’  
/usr/lib/ruby/1.8/mongrel.rb:285:in `run' /usr/lib/ruby/1.8/mongrel.rb:268:in `initialize’  
/usr/lib/ruby/1.8/mongrel.rb:268:in `new' /usr/lib/ruby/1.8/mongrel.rb:268:in `run’  
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:34:in  
`run' /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:111 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem\_original\_require’  
/usr/local/lib/site\_ruby/1.8/rubygems/custom\_require.rb:31:in  
`require’  
script/server:3

---

<div class="post-metadata">

**Author:** ![agnathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@agnathan](https://www.ruby-forum.com/u/agnathan)\
**Post date:** [September 23, 2009, 7:16pm UTC](https://www.ruby-forum.com/t/mysql/175946/4 "2009-09-23T19:16:52Z")

</div>

Daniel Hutchinson wrote:

Solved!

I decide to new post because I posted with MySQL title which dont say  
nothing about the real problem

So when i get the message

"Client does not support authentication protocol requested by server;

> consider upgrading MySQL client"

or after run rake db:create

get error message “could create table…”

* * *

after spend time I and look carefully the messages

google the message “Client does not support…” and found the next link

> **[Client does not support authentication protocol requested by server – Buayacorp](https://www.buayacorp.com/archivos/client-does-not-support-authentication-protocol-requested-by-server/)**
>
> Siempre que hago una nueva instalación de MySQL, y entro por phpMyAdmin para administrar mi base de datos me encuentro con el siguiente error: #1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL...

where Braulio teach why is the problem and how to solve it

is something about authentication protocol issue with mysql 4.1. → 5.0  
and rails 2.3.4

and solve as this

get into mysql

$mysql -u root -p  
enter your pwd  
and then enter the line

SET PASSWORD FOR ‘root’@‘localhost’ = OLD\_PASSWORD(‘pwd’);

and thats it!

quit the mysql session

run rake db:migrate  
then script/server  
get into localhost:3000  
and is working now

slds
