Shawn Kelly (6) [Avatar] Offline
#1
Hi,

I can't figure out why I get "Permission denied" when trying to run newdb.bat:

MacBook-Pro:~ Shawn$ /Users/Shawn/flexiblerails/current/pomodo/newdb.bat
-bash: /Users/Shawn/flexiblerails/current/pomodo/newdb.bat: Permission denied


Please Help!!!
Thanks...

OS 10.5.2 Rails 2.02 FlexBuilder 3
peterarmstrong (94) [Avatar] Offline
#2
Re: Iteration 2: Page 40 - newdb.bat: Permission denied
On Mac, you want to use newdb.sh (see chapter 2).

Also, you need to make it executable, e.g. chmod 755 newdb.sh.

-Peter
Shawn Kelly (6) [Avatar] Offline
#3
Re: Iteration 2: Page 40 - newdb.bat: Permission denied
Hello all,

Not making much progress here. I have gone back and checked everything several times but after creating newdb.sh and making it executable with chmod 755 newdb.sh I continue to get the following when running it:

Shawns-iMac:pomodo Shawn$ ./newdb.sh
./newdb.sh: line 2: mysql: command not found
(in /Users/Shawn/flexiblerails/current/pomodo)
rake aborted!
No such file or directory - /tmp/mysql.sock

(See full trace by running task with --trace)


My newdb.sh file looks like this:

#!/bin/sh
mysql -h localhost -u root -p <db/create.sql >
rake db:migrate


I'm running Leopard, Rails 2.02, and MySql 5.0.51a

Thanks for the help!
Shawn
Shawn Kelly (6) [Avatar] Offline
#4
Re: Iteration 2: Page 40 - newdb.bat: Permission denied
I think it's a path problem with mysql... I updated the path and now I'm here:

Shawns-iMac:pomodo Shawn$ ./newdb.sh
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
(in /Users/Shawn/flexiblerails/current/pomodo)
rake aborted!
No such file or directory - /tmp/mysql.sock

(See full trace by running task with --trace)


Thanks,
Shawn
peterarmstrong (94) [Avatar] Offline
#5
Re: Iteration 2: Page 40 - newdb.bat: Permission denied
If you're completely stuck on MySQL, then just try SQLite.

When creating the application, just do "rails pomodo" instead of "rails -d mysql pomodo".

Of course, all the mysql command line stuff you do will need to be adapted to SQLite...
Shawn Kelly (6) [Avatar] Offline
#6
Re: Iteration 2: Page 40 - newdb.bat: Permission denied
Ok, got it working. My mistakes were as follows:

1. After installing MySQL on Leopard I did not add it to the path as described in the MySQL Manual here: http://dev.mysql.com/doc/refman/5.1/en/mac-os-x-installation.html

2. The MySQL server was OFF when I though it was ON... Oops!

3. The MySQL username is root and password is blank by default. I was using the wrong password.

All newbie mistakes for sure! Hopefully this helps anyone and inexperienced as I am!

Peter, thanks for you quick replies. It's great to know you monitor this, even on sunday morning!