On Thu, Jun 16, 2011 at 8:03 PM, Maze <[email protected]> wrote: > Hi, > > So I'm new to MYSQL and RoR. I am trying to learn ruby on rails, but > i'm having a problem with MYSQL. > > I am using Mac OS X 10.6 Snow Leopard (10.6.7). > > To install MYSQL i done: > > brew install mysql > > Which installed mysql, but when I do "mysql_install_db" this comes up: > > " > FATAL ERROR: Could not find ./bin/my_print_defaults > > If you compiled from source, you need to run 'make install' to > copy the software into the correct location ready for operation. > > If you are using a binary release, you must either be at the top > level of the extracted archive, or pass the --basedir option > pointing to that location. > " > > and when I do "mysql -u root" this comes up: > " > ERROR 2002 (HY000): Can't connect to local MySQL server through socket > '/tmp/mysql.sock' (2) > " > > You can't connect to it because you haven't started it yet. homebrew gives you specific instructions to perform after installation:
$ brew info mysql > mysql 5.5.10 > http://dev.mysql.com/doc/refman/5.5/en/ > Depends on: cmake, readline, pidof > /usr/local/Cellar/mysql/5.5.10 (6232 files, 219M) > Set up databases to run AS YOUR USER ACCOUNT with: > unset TMPDIR > mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix > mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp > To set up base tables in another folder, or use a differnet user to run > mysqld, view the help for mysqld_install_db: > mysql_install_db --help > and view the MySQL documentation: > * http://dev.mysql.com/doc/refman/5.5/en/mysql-install-db.html > * http://dev.mysql.com/doc/refman/5.5/en/default-privileges.html > To run as, for instance, user "mysql", you may need to `sudo`: > sudo mysql_install_db ...options... > Start mysqld manually with: > mysql.server start > Note: if this fails, you probably forgot to run the first two steps up > above > A "/etc/my.cnf" from another install may interfere with a Homebrew-built > server starting up correctly. > To connect: > mysql -uroot > To launch on startup: > * if this is your first install: > mkdir -p ~/Library/LaunchAgents > cp /usr/local/Cellar/mysql/5.5.10/com.mysql.mysqld.plist > ~/Library/LaunchAgents/ > launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist > * if this is an upgrade and you already have the com.mysql.mysqld.plist > loaded: > launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist > cp /usr/local/Cellar/mysql/5.5.10/com.mysql.mysqld.plist > ~/Library/LaunchAgents/ > launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist > You may also need to edit the plist to use the correct "UserName". > > http://github.com/mxcl/homebrew/commits/master/Library/Formula/mysql.rb Note the specific commands: > unset TMPDIR > mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp > mysql.server start > mysql -uroot Just copy & paste them from the instructions. Adam Stegman -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

