1

I saw that a mysql2 gem is installed, but no mysql. So I did a little $ brew install mysql, and I'm getting this warning:

Warning: mysql-5.6.13 already installed

What should I do to remedy this?

Here are the local gems(condensed of course):

 *** LOCAL GEMS ***

    multipart-post (1.2.0)
    mysql2 (0.3.13)
    net-scp (1.1.2)
novicePrgrmr
  • 18,647
  • 31
  • 81
  • 103

1 Answers1

1

It is entirely possible that mysql is already installed on your machine. Try typing which mysql in your terminal (assuming you're on OSX) and you may have to add the result to your $PATH.

The mysql2 you're seeing is only a gem, which is not the same thing as mysql.

NM Pennypacker
  • 6,704
  • 11
  • 36
  • 38
  • Seeing this: ``$ which mysql /usr/local/bin/mysql`` Which I think is the right path. Do I still need to add it to my path? And if yes, how do I do that? Thanks in advance! – novicePrgrmr Oct 22 '13 at 23:56
  • export PATH=$PATH:/usr/local/mysql – NM Pennypacker Oct 22 '13 at 23:58
  • just into the terminal? would it be ``PATH=$PATH:/usr/local/bin/mysql`` vs ``PATH=$PATH:/usr/local/mysql`` ? – novicePrgrmr Oct 22 '13 at 23:58
  • Sorry, yes, Then try running the command mysql and you should be good to go. You may have to run mysql.server start to get the mysql server running. – NM Pennypacker Oct 22 '13 at 23:58
  • Ok, so it looks like it's good to go: ``$ mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1486 Server version: 5.1.43 MySQL Community Server (GPL) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> `` – novicePrgrmr Oct 23 '13 at 00:02
  • Thanks,still only showing ``mysql2`` in ``gem list`` though. Do I need to do anything else? – novicePrgrmr Oct 23 '13 at 00:07
  • Nope, you're good to go. The mysql2 gem is just an adapter. Once you're in mysql you can do CREATE DATABASE your_database_name; and make sure to modify your config/database.yml file to point to that database. – NM Pennypacker Oct 23 '13 at 00:11
  • Ok great. I am still having an issue with creating the DB for my RoR project using ``rake db:setup``. I created a separate question, if you'd take a quick look I'd be super grateful. http://stackoverflow.com/questions/19530089/getting-cant-connect-to-local-mysql-server-through-socket-var-run-mysqld-mys – novicePrgrmr Oct 23 '13 at 00:13
  • Answered the question over there. – NM Pennypacker Oct 23 '13 at 00:15