Just started using Instant rails 1.7. I want to look at the MySQL server and see my database. So I type ''instantrails folder''>mysql -u root mysql>select database(); and it just gives me a null! I''ve already created a database (I''ve been following Agile Web Development with RoR). Don''t know a huge amount about how MySQL works but what I''ve read so far doesn''t get me anywhere. Thanks for your time.... -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Robert Arbon wrote:> Just started using Instant rails 1.7. I want to look at the MySQL > server and see my database. So I type > > ''instantrails folder''>mysql -u root > > mysql>select database(); > > and it just gives me a null! I''ve already created a database (I''ve been > following Agile Web Development with RoR). Don''t know a huge amount > about how MySQL works but what I''ve read so far doesn''t get me anywhere. > > Thanks for your time....I also installed the GUI ''MySQL Admin'' but that doesn''t seem to want to connect to ''local host''. I have it running in a directory outside the ''Instant Rails'' directory if that helps. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Robert Arbon wrote:> Robert Arbon wrote: > >> Just started using Instant rails 1.7. I want to look at the MySQL >> server and see my database. So I type >> >> ''instantrails folder''>mysql -u root >> >> mysql>select database(); >> >> and it just gives me a null! I''ve already created a database (I''ve been >> following Agile Web Development with RoR). Don''t know a huge amount >> about how MySQL works but what I''ve read so far doesn''t get me anywhere. >> >> Thanks for your time.... >> > > I also installed the GUI ''MySQL Admin'' but that doesn''t seem to want to > connect to ''local host''. I have it running in a directory outside the > ''Instant Rails'' directory if that helps. >I''m not sure if it''s a typo, but it should be localhost, no space. Cheers, Mohit. 1/9/2008 | 10:04 PM. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
2008/1/8 Robert Arbon <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:> > Just started using Instant rails 1.7. I want to look at the MySQL> mysql>select database(); > > and it just gives me a null!Uh, no surprise -- where did you find that "command"? In any case, mysql> SHOW DATABASES; ...list of databases will be displayed... mysql> USE foo_development; mysql> SHOW TABLES; ...list of tables will be displayed... Reading a basic SQL book or tutorial plus skimming the MySQL documentation would probably be a good idea :-) HTH, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hassan Schroeder wrote:> 2008/1/8 Robert Arbon <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>: >> >> Just started using Instant rails 1.7. I want to look at the MySQL > >> mysql>select database(); >> >> and it just gives me a null! > > Uh, no surprise -- where did you find that "command"? In any case, > > mysql> SHOW DATABASES; > ...list of databases will be displayed... > mysql> USE foo_development; > mysql> SHOW TABLES; > ...list of tables will be displayed... > > Reading a basic SQL book or tutorial plus skimming the MySQL > documentation would probably be a good idea :-) > > HTH, > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.orgThanks! I had actually done the MySQL tutorial...and looked there before I posted (honest!) I just realised my confusion...my commands show what databases are currently selected...I was reading the wrong section. HOWEVER... I thought though that the database I was using with instant rails would be ''connected'' (i.e. I was working on it at the time and had just created a new table) so my command: mysql>select database(); Should be valid non? I had just read this bit in the docs: 3.4. Getting Information About Databases and Tables What if you forget the name of a database or table, or what the structure of a given table is (for example, what its columns are called)? MySQL addresses this problem through several statements that provide information about the databases and tables it supports. You have previously seen SHOW DATABASES, which lists the databases managed by the server. To find out which database is currently selected, use the DATABASE() function: mysql> SELECT DATABASE(); +------------+ | DATABASE() | +------------+ | menagerie | +------------+ Thanks again. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
:) You don''t quite get what you''re doing. When you log in as you did, there''s no database selected. The Rails application has a connection to your database, but you don''t, since you logged in again as a new connection. You want USE, not SELECT DATABASE. use depot_production; select * from products; describe products; You should investigate using the Rails Console to look at your data. It''s often faster, and you''ll learn a little more about Ruby that way too. On Jan 9, 2008 9:40 AM, Robert Arbon <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hassan Schroeder wrote: > > 2008/1/8 Robert Arbon <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>: > >> > >> Just started using Instant rails 1.7. I want to look at the MySQL > > > >> mysql>select database(); > >> > >> and it just gives me a null! > > > > Uh, no surprise -- where did you find that "command"? In any case, > > > > mysql> SHOW DATABASES; > > ...list of databases will be displayed... > > mysql> USE foo_development; > > mysql> SHOW TABLES; > > ...list of tables will be displayed... > > > > Reading a basic SQL book or tutorial plus skimming the MySQL > > documentation would probably be a good idea :-) > > > > HTH, > > -- > > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > Thanks! I had actually done the MySQL tutorial...and looked there > before I posted (honest!) > > I just realised my confusion...my commands show what databases are > currently selected...I was reading the wrong section. > > HOWEVER... > > I thought though that the database I was using with instant rails would > be ''connected'' (i.e. I was working on it at the time and had just > created a new table) so my command: > > mysql>select database(); > > Should be valid non? I had just read this bit in the docs: > > 3.4. Getting Information About Databases and Tables > > What if you forget the name of a database or table, or what the > structure of a given table is (for example, what its columns are > called)? MySQL addresses this problem through several statements that > provide information about the databases and tables it supports. > > You have previously seen SHOW DATABASES, which lists the databases > managed by the server. To find out which database is currently selected, > use the DATABASE() function: > > mysql> SELECT DATABASE(); > +------------+ > | DATABASE() | > +------------+ > | menagerie | > +------------+ > > > > Thanks again. > > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Brian Hogan wrote:> :) You don''t quite get what you''re doing. When you log in as you did, > there''s no database selected. The Rails application has a connection to > your > database, but you don''t, since you logged in again as a new connection. > > You want USE, not SELECT DATABASE. > > use depot_production; > select * from products; > describe products; > > > You should investigate using the Rails Console to look at your data. > It''s > often faster, and you''ll learn a little more about Ruby that way too. > > > > > On Jan 9, 2008 9:40 AM, Robert Arbon <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>By ''Rails Console'' you mean the Ruby Console? Cos if so, I was using the Rails Console. Oh well, thanks for the input, I think I need to read more about mySQL. Thanks again -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---