**Update: If you already have MAMP installed, you can just use the MAMP MySQL which is at /Applications/MAMP/Library/bin/mysql Socket (if MAMP is running) is at:/Applications/MAMP/tmp/mysql/mysql.sock I had previously read that using MAMP’s mysql DB with Rails was a problem. But it works for Sinatra at least.** Installing mysql without macports. Posting these instructions b/c I [...]
**Update: If you already have MAMP installed, you can just use the MAMP MySQL which is at /Applications/MAMP/Library/bin/mysql
Socket (if MAMP is running) is at:/Applications/MAMP/tmp/mysql/mysql.sock
I had previously read that using MAMP’s mysql DB with Rails was a problem. But it works for Sinatra at least.**
Installing mysql without macports. Posting these instructions b/c I just had to install mysql on my new work machine and I’d forgotten how since the last time I’d installed it. Before we get started, here’s a great mysql resource http://www.pantz.org/software/mysql/mysqlcommands.html.
1) download the dmg from http://dev.mysql.com/downloads/
2) Quit out of MAMP and try to confirm no other mysql processes are running. Do this by typing
in your terminal. Look for a process called “mysqld”. If you find a process, and are certain you’ve not installed mysql, and you’re certain you’ve quit MAMP, you can a) run a grep to find this process b)
where PID is the process ID number of whatever mysqld you find when you do
.
2a) With no mysql processes running, double click the dmg and run the install and use the defaults.
3) add preference pane ( should be an executable file when you open the .dmg package).
4) add start up item ( another executable file when you open the .dmg package).
5) Start mysql
default install is to
So we can do:
6) You can now log-in by doing:
7) Instead of typing the above path everytime you want to log-in to mysql, add the path to mysql to your .bash_profile in your home directory ( ~/ )
e.g.
Lastly, if you’re doing Ruby on Rails development, you may need to know the location of your mysql.sock file in order to properly configure config/database.yml. The file is often stored in /private/tmp/mysql.sock. Update: You can confirm the location of the file by doing
***************IMPORTANT!
This mysql.sock file is only present if the mysql process is running. And it has to be the correct mysql process. If you’re using MAMP or something else, you’ll want to quit out of that app before searching for the mysql.sock. You can check and confirm mysql is running by a) trying to log-in b) type
in your terminal to view all processes. Make sure mysql is running before you spend time looking for the .sock file!
Create a root user and set pw. Finally, to use mysql you’ll need to create a root user and set the password. Do so like this, from the terminal, not logged in to mysql, type:
This creates a user “root” and sets no password. If you want to set a password, do the above and add your password on to the end of the command.
Again, this site is a tremendous tremendous mysql resource http://www.pantz.org/software/mysql/mysqlcommands.html
Content © professional dilettante
Proudly powered by WordPress
Theme designed by Artisan Themes
22 queries.
0.544 seconds.
blah blah blah
sql this sql that