Reputation: 6121
I've tried to install mysql on OSX many a time and failed every time - I've tried installing it with macports, brew and somethign else, I can't remember. I ended up having someone who knows what they're doing getting it to work.
After it was installed, Rails happily obliged in creating databases for me. However, at this point, I need to run some arbitrary queries and upon running 'mysql' command in the terminal I see that the databases available through there are absolutely not what rails created.
Is it possible to have TWO versions of mysql installed or something? (Since I tried it so many times both with brew and macports) How would I check where Rails is saving databases and tables to and what location 'mysql' command in the terminal is trying to access?
I hope the question makes sense. I wasn't the one who ultimately got it to work so my knowledge of how it works is pretty weak.
Thanks in advance.
Upvotes: 0
Views: 169
Reputation: 2775
you try to log usgin mysql
command and then, show databases;
.
$ mysql -u username -p
show databases;
It's not too common to have two installations. If your ruby programs are not specifying any specific hostname while connecting to database, then the command above should show exactly what your programs would be accessing too.
try to use netstat to check what ports are open and on LISTENING state
$ netstat -na | grep LISTENING
After this, you can try to connect to any mysql host using the -h hostname
option from the shell and check what databases exists.
Upvotes: 1