Hello, I am building my first application with MySQL database and I am solving this problem - my app can''t to connect to MySQL server. MySQL server is running, in terminal (I am working at Mac) I created MySQL table and I set password to MySQL with using following command: mysqladmin -u root password ''mypass'' in database.yml is: development: adapter: mysql2 encoding: utf8 reconnect: false database: accounts pool: 5 username: root password: mypass socket: /tmp/mysql.sock And now I am trying my application, I am getting in browser error: Mysql2::Error Access denied for user ''root''@''localhost'' (using password: YES) I don''t know what could be wrong -- the passwords are the same, I thought is needed restart MySQL server -- so I did it, but still the same error... Could me someone help, please, where is fault? I am wondering about this error whole afternoon, but without success... Thanks a lot. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sat, May 21, 2011 at 3:41 PM, Manny 777 <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hello, > > I am building my first application with MySQL database and I am solving > this problem - my app can''t to connect to MySQL server. > > MySQL server is running, in terminal (I am working at Mac) I created > MySQL table and I set password to MySQL with using following command: > > mysqladmin -u root password ''mypass'' > > in database.yml is: > > development: > adapter: mysql2 > encoding: utf8 > reconnect: false > database: accounts > pool: 5 > username: root > password: mypass > socket: /tmp/mysql.sock > > And now I am trying my application, I am getting in browser error: > > Mysql2::Error > Access denied for user ''root''@''localhost'' (using password: YES) > > > I don''t know what could be wrong -- the passwords are the same, I > thought is needed restart MySQL server -- so I did it, but still the > same error... > > Could me someone help, please, where is fault? I am wondering about this > error whole afternoon, but without success... > > Thanks a lot. > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >Hello Manny Use another user, not root Create a new user, for example, deploy, give permissions GRANT over the DB. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Martin, why is not possible to use the user "root"? Could you please give me know, how to do the new user with grant permission? (no experience with GRANT yet). Thanks in advance. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Tom Meinlschmidt
2011-May-21 19:52 UTC
Re: Re: RoR and problem with connection to MySQL database
Hi, in mysql console create database database_name; grant all on database.* to username@localhost identified by ''password''; flush privileges; tom On May 21, 2011, at 21:00 , Manny 777 wrote:> Hi Martin, > > why is not possible to use the user "root"? > > Could you please give me know, how to do the new user with grant > permission? (no experience with GRANT yet). > Thanks in advance. > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- ==============================================================================Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz ============================================================================== -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks Tom, finally it works for me! :) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Maybe Matching Threads
- Advice needed --- Best way to get mysql2 gem installed to interact with Mysql Database?
- Rails and MySQL
- connect': Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) (Mysql2
- mysql compatibility error--already reported by another correspondent
- GEMFile gem 'mysql2' and mysql version is 4.1.2