SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Street Fighting in the rubble of Stalingrad during WW2 is easier than Patrick Lenz's

    “If I can do it then it can’t be done ! …”.

    Hi Everybody !

    … book “Build Your Own Ruby on Rails Web Applications”.

    The problem is that at the moment, I don’t know if I’m the side of the German fascist Werhmacht (who lost) or the Soviet Communist Red Army (who won).

    The good news is that I’m definitely making progress !

    I’m now stuck on page 30 of Patrick Lenz’s book “Build Your Own Ruby on Rails Web Applications”.

    I’m pretty sure that I’ve finally gotten everything installed and working.

    Well, come to think of it, actually I’m not. I suspect that if everything were properluy installed then I wouldn’t be having problems confirming the MySQL installation on Mac OSX.

    My last problem was getting the mysql server up and running.

    It turns out that the command :

    Sudo /usr/local/bin/mysqld_safe5

    Is not correct.

    For my setup the correct command is :

    sudo /usr/local/mysql/bin/mysqld_safe

    Now, that’s progress !

    I’ve also installed “MySQLStartupItem.pkg” & “MySQL.prefPane”.

    These 2 items enable me to easily startup MySQL from the System Preference application.

    The MySQL System Preferences Panel (rather a nifty icon I might add !) sez :

    The MySQL Server Instance is running

    If I type in the following command on the terminal :

    ps –ax | grep mysql

    I get the following :

    272 ?? S 0:00.04 /bin/sh ./bin/mysqld_safe --datadir=/usr/local/mysq
    291 ?? S 0:03.87 /usr/local/mysql/bin/mysqld --basedir=/usr/local/my
    696 p1 R+ 0:00.00 grep mysql

    This sort of looks like the output listed on Figure 2.12 Confirming MySQL installation on Mac OSX shown on page 30.

    It’s not exactly the same but the problem is that I just don’t know if what I’m getting is OK or not.

    If I then type in mysql5 I get :

    -bash: mysql: command not found

    If I type in :

    user-12ldlhq:~ simonwhelan$ cd /usr/local/mysql
    user-12ldlhq:/usr/local/mysql simonwhelan$ ls

    I get :

    COPYING data scripts
    EXCEPTIONS-CLIENT docs share
    INSTALL-BINARY include sql-bench
    README lib support-files
    bin man tests
    configure mysql-test

    If I type in :

    user-12ldlhq:~ simonwhelan$ cd /usr/local/mysql/bin
    user-12ldlhq:/usr/local/mysql/bin simonwhelan$ ls

    I get :

    CMakeLists.txt mysqld-debug
    comp_err mysqld_multi
    comp_sql.c mysqld_safe
    make_sharedlib_distribution mysqldump
    make_win_bin_dist mysqldumpslow
    make_win_src_distribution mysqlhotcopy
    msql2mysql mysqlimport
    my_print_defaults mysqlmanager
    myisam_ftdump mysqlshow
    myisamchk mysqltest
    myisamlog mysqltestmanager
    myisampack mysqltestmanager-pwgen
    mysql mysqltestmanagerc
    mysql_client_test ndb_config
    mysql_config ndb_cpcd
    mysql_convert_table_format ndb_delete_all
    mysql_explain_log ndb_desc
    mysql_find_rows ndb_drop_index
    mysql_fix_extensions ndb_drop_table
    mysql_fix_privilege_tables ndb_error_reporter
    mysql_fix_privilege_tables_sql.c ndb_mgm
    mysql_secure_installation ndb_mgmd
    mysql_setpermission ndb_restore
    mysql_tableinfo ndb_select_all
    mysql_tzinfo_to_sql ndb_select_count
    mysql_upgrade ndb_show_tables
    mysql_upgrade_shell ndb_size.pl
    mysql_waitpid ndb_test_platform
    mysql_zap ndb_waiter
    mysqlaccess ndbd
    mysqlaccess.conf perror
    mysqladmin replace
    mysqlbinlog resolve_stack_dump
    mysqlbug resolveip
    mysqlcheck safe_mysqld

    If “/usr/local/mysql/bin” is the correct directory (and, to tell you the truth, I just don’t know enough to even be sure of that), well, there’s no “mysql5” in this directory.

    There are, however :

    • mysql
    • mysqld
    • mysqld_safe

    If I type in :

    /usr/local/mysql/bin/mysql

    I get :

    Access denied for user 'simonwhelan'@'localhost' (using password: NO)

    So, maybe this is correct and it might work if I gave it the correct password.

    The problems are :

    1. I don’t know what the password is.
    2. Even if I did know what the correct password is, I still don’t know how to set it.

    So, if this is the correct command then my questions are :

    1. What is the correct password ?
    2. How and where do I set the damn password ?

    Ion the other hand, if I type in :

    /usr/local/mysql/bin/mysqld

    I get :

    070719 23:11:24 [Warning] Can't create test file /usr/local/mysql-5.0.45-osx10.4-powerpc/data/user-12ldlhq.lower-test
    070719 23:11:24 [Warning] Can't create test file /usr/local/mysql-5.0.45-osx10.4-powerpc/data/user-12ldlhq.lower-test
    /usr/local/mysql/bin/mysqld: Can't change dir to '/usr/local/mysql-5.0.45-osx10.4-powerpc/data/' (Errcode: 13)
    070719 23:11:24 [ERROR] Aborting

    070719 23:11:24 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

    Then again, on the other, other hand, if I type in :

    /usr/local/mysql/bin/mysqld_safe

    I get :

    touch: /usr/local/mysql/data/user-12ldlhq.cable.mindspring.com.err: Permission denied
    chown: /usr/local/mysql/data/user-12ldlhq.cable.mindspring.com.err: Permission denied
    Starting mysqld daemon with databases from /usr/local/mysql/data
    /usr/local/mysql/bin/mysqld_safe: line 380: /usr/local/mysql/data/user-12ldlhq.cable.mindspring.com.err: Permission denied
    rm: /tmp/mysql.sock: Permission denied
    rm: /usr/local/mysql/data/user-12ldlhq.cable.mindspring.com.pid: Permission denied
    /usr/local/mysql/bin/mysqld_safe: line 386: /usr/local/mysql/data/user-12ldlhq.cable.mindspring.com.err: Permission denied
    STOPPING server from pid file /usr/local/mysql/data/user-12ldlhq.cable.mindspring.com.pid
    tee: /usr/local/mysql/data/user-12ldlhq.cable.mindspring.com.err: Permission denied
    070719 23:12:48 mysqld ended
    tee: /usr/local/mysql/data/user-12ldlhq.cable.mindspring.com.err: Permission denied

    I have to tell you that I’m really getting fed up.

    So far as I know I’m following Patrick’s instructions to the letter and the damn things just don’t work !

    The problem is that I just don’t know enough to know what I’m doing wrong much less what the problem is.

    Does anybody have any idea what’s wrong, and, more importantly what I have to do in order get the damn MySQL database up and working properly ?

    I really would appreciate any suggestions, advice and help anybody could send me.

    I just don’t understand why this is so damned difficult !

    Most things you install under Mac OSX just work !
    Last edited by stymiee; Jul 19, 2007 at 19:29. Reason: all communication has to occur in the forums

  2. #2
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    User root is automatically created with no password.
    mysql -u root

    mysqld_safe fails because it is already running.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  3. #3
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Interesting, informativ e & educational but not helpful …

    Email : simonwhel@yahoo.com

    “If I can do it then it can’t be done ! …”.

    Hi samsn :

    1st off, I would like to thank you both for the celerity of your response and the response itself to my latest posting regarding my difficulties in getting my Ruby on Rails environment up and working as per the instructions contained in Chapter 2 (i.e. : “Getting Started”) of Patrick Lenz’s book “Build Your Own Ruby on Rails Web Applications” (or, as I’m now starting to think of it : “BYORORWA”).

    It was interesting, informative and educational.

    Unfortunately, it was not in any way helpful.

    This may be more due to my basic lack of understanding and missing background with regard to Command Line Programming on Unix like systems such as BSD which, I understand is the bottom half of Mac OSX 10.4.10 than it has to do with the content of your posting itself.

    Rightly or wrongly (actually, I guess I’d have to say “wrongly” given the divergent and mystifying responses I got to my efforts to follow Patrick’s installation instructions with a sincere, preternatural, yet doglike devotion) I actually expected to have my Terminal window display results similar (if not identical) to the results listed in Figure 2.12, “Confirming MySQL installation of Mac OSX” at the bottom of page 30 in Chapter 2 (“Getting Started”).

    In other words, Patrick entered :

    mysql5

    And got back :

    Welcome to the MySQL monitor. Commands end with ; or \g
    Your MySQL connection id is 8 to server version 5.0.24

    Type ‘help’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

    Mysql> exit
    Bye


    If I enter

    mysql5

    I get :

    -bash: mysql5: command not found


    If I enter

    mysql

    I get :

    -bash: mysql: command not found


    If I enter

    mysqld

    I get :

    -bash: mysqld: command not found


    If I enter

    mysqld_safe

    I get :

    -bash: mysqld_safe: command not found


    If I enter

    /usr/local/mysql/bin/mysql5

    I get :

    -bash: /usr/local/mysql/bin/mysql5: No such file or directory


    If I enter

    /usr/local/mysql/bin/mysql

    I get :

    ERROR 1045 (28000): Access denied for user 'simonwhelan'@'localhost' (using password: NO)


    If I enter

    /usr/local/mysql/bin/mysqld

    I get :

    070720 12:00:32 [Warning] Can't create test file /usr/local/mysql-5.0.45-osx10.4-powerpc/data/simon-whelans-power-mac-g5.lower-test
    070720 12:00:32 [Warning] Can't create test file /usr/local/mysql-5.0.45-osx10.4-powerpc/data/simon-whelans-power-mac-g5.lower-test
    /usr/local/mysql/bin/mysqld: Can't change dir to '/usr/local/mysql-5.0.45-osx10.4-powerpc/data/' (Errcode: 13)
    070720 12:00:32 [ERROR] Aborting

    070720 12:00:32 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete


    If I enter

    /usr/local/mysql/bin/mysqld_safe

    I get :

    simon-whelans-power-mac-g5:~ simonwhelan$ /usr/local/mysql/bin/mysqld_safe
    touch: /usr/local/mysql/data/simon-whelans-power-mac-g5.local.err: Permission denied
    chown: /usr/local/mysql/data/simon-whelans-power-mac-g5.local.err: Permission denied
    Starting mysqld daemon with databases from /usr/local/mysql/data
    /usr/local/mysql/bin/mysqld_safe: line 380: /usr/local/mysql/data/simon-whelans-power-mac-g5.local.err: Permission denied
    rm: /tmp/mysql.sock: Permission denied
    rm: /usr/local/mysql/data/simon-whelans-power-mac-g5.local.pid: Permission denied
    /usr/local/mysql/bin/mysqld_safe: line 386: /usr/local/mysql/data/simon-whelans-power-mac-g5.local.err: Permission denied
    STOPPING server from pid file /usr/local/mysql/data/simon-whelans-power-mac-g5.local.pid
    tee: /usr/local/mysql/data/simon-whelans-power-mac-g5.local.err: Permission denied
    070720 12:02:04 mysqld ended
    tee: /usr/local/mysql/data/simon-whelans-power-mac-g5.local.err: Permission denied


    None of these responses look anything like the response Patrick sez I should get at the bottom of page 30.

    So, I then have to ask the following questions :

    1. Why are the responses I’m getting different from what Patrick sez I should get ?
    2. What am I doing wrong ?
    3. What am I missing here; i.e. : is there some defect in my understanding that is confusing me here?

    If anyone can explain to me what I’m doing wrong I would really appreciate it.

    I’d like to thank anyone and everyone for any help, advice, answers, solutions or suggestions you could send my way.

    Thank you !

    Comme toujours, here is my contact information :

    1. Email : simonwhel@yahoo.com
    2. Phone : 718-777-7731

    The easiest times to reach me are in the mornings before 11:00 AM or in the evening after about 7:00 PM.

    All the best & talk to you soon … Simon.

  4. #4
    SitePoint Member
    Join Date
    Jul 2007
    Location
    Australia
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry if you have already tried this, but I didn't see it in your previous posts:
    (Also I'm using windows vista so chances are this might not work, but worth a try)

    I open up a ruby console window (not the command prompt)
    and enter:
    > mysql -u root

    I haven't tried it on a mac, but maybe try
    > mysql5 -u root
    if the first option doesn't work

    I hope this is helpful, I was receiving the same kind of issues that you are until I typed this in.

  5. #5
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks for the suggestion Katrinay but it didn't seem to work …

    Email : simonwhel@yahoo.com

    “If I can do it then it can’t be done ! …”.

    Hi katrinay :

    Thank you for taking the time to post your suggestions for my MySQL vail of travail & tears.

    “I gave it a whirl”.

    Unfortunately, it didn’t work.

    Then again, on the plus side, it did give me an excuse to try out and get familiar with “Old Uncle ‘irb’”.

    So, here’s what I did :

    I entered ‘irb’ into the Terminal window and I got back :

    irb(main):001:0>

    I then entered :

    mysql -u root

    I got back :

    SyntaxError: compile error
    (irb):21: parse error, unexpected tIDENTIFIER, expecting kDO or '{' or '('
    from (irb):21
    from :0

    I then entered :

    mysql5 -u root

    I got back :

    SyntaxError: compile error
    (irb):2: parse error, unexpected tIDENTIFIER, expecting kDO or '{' or '('
    from (irb):2


    I then entered :

    mysqld -u root

    I got back :

    SyntaxError: compile error
    (irb):4: parse error, unexpected tIDENTIFIER, expecting kDO or '{' or '('
    from (irb):4


    I then entered :

    mysqld_safe -u root

    I got back :

    SyntaxError: compile error
    (irb):6: parse error, unexpected tIDENTIFIER, expecting kDO or '{' or '('
    from (irb):6
    from :0



    I then entered :

    /usr/local/mysql/bin/mysql -u root

    I got back :

    SyntaxError: compile error
    (irb):6: parse error, unexpected tIDENTIFIER, expecting kDO or '{' or '('
    from (irb):6
    from :0
    irb(main):007:0>
    irb(main):008:0* /usr/local/mysql/bin/mysql -u root
    SyntaxError: compile error
    (irb):8: unknown regexp options - lcal
    (irb):8: parse error, unexpected tUMINUS, expecting kDO or '{' or '('
    /usr/local/mysql/bin/mysql -u root
    ^
    from (irb):8
    from :0


    I then entered :

    /usr/local/mysql/bin/mysql5 -u root

    I got back :

    SyntaxError: compile error
    (irb):8: unknown regexp options - lcal
    (irb):8: parse error, unexpected tUMINUS, expecting kDO or '{' or '('
    /usr/local/mysql/bin/mysql -u root
    ^
    from (irb):8
    from :0
    irb(main):009:0>
    irb(main):010:0* /usr/local/mysql/bin/mysql5 -u root
    SyntaxError: compile error
    (irb):10: unknown regexp options - lcal
    (irb):10: parse error, unexpected tUMINUS, expecting kDO or '{' or '('
    /usr/local/mysql/bin/mysql5 -u root
    ^
    from (irb):10
    from :0


    I then entered :

    /usr/local/mysql/bin/mysqld -u root

    I got back :

    SyntaxError: compile error
    (irb):12: unknown regexp options - lcal
    (irb):12: parse error, unexpected tUMINUS, expecting kDO or '{' or '('
    /usr/local/mysql/bin/mysqld -u root
    ^
    from (irb):12
    from :0
    irb(main):013:0>
    irb(main):014:0* /usr/local/mysql/bin/mysqld -u root
    SyntaxError: compile error
    (irb):14: unknown regexp options - lcal
    (irb):14: parse error, unexpected tUMINUS, expecting kDO or '{' or '('
    /usr/local/mysql/bin/mysqld -u root
    ^
    from (irb):14
    from :0


    I then entered :

    /usr/local/mysql/bin/mysqld_safe -u root

    I got back :

    SyntaxError: compile error
    (irb):18: unknown regexp options - lcal
    (irb):18: parse error, unexpected tUMINUS, expecting kDO or '{' or '('
    /usr/local/mysql/bin/mysqld_safe -u root
    ^
    from (irb):18
    from :0
    irb(main):019:0> =]
    SyntaxError: compile error
    (irb):19: parse error, unexpected '='
    from (irb):19
    from :0


    In other words, none of the following commands work :

    mysql -u root
    mysql5 -u root
    mysqld -u root
    mysqld_safe -u root
    /usr/local/mysql/bin/mysql -u root
    /usr/local/mysql/bin/mysql5 -u root
    /usr/local/mysql/bin/mysqld -u root
    /usr/local/mysql/bin/mysqld_safe -u root


    And none of them worked.

    Frankly, I just don’t get it. How can it be this hard to just connect to a damn database ?

    So far as I’ve been able to determine, I’ve been following the instructions in the damn book precisely. They don’t seem to work.

    What’s even stranger to me is that other people who are also using Mac OSX are reporting that they aren’t having any problems getting the MySQL database to work.

    Is there something wrong with my setup ? I’ve reinstalled everything from scratch 4 times ! My setup seems to be pretty standard.

    If anyone can explain to me what I’m doing wrong I would really appreciate it.

    I’d like to thank anyone and everyone for any help, advice, answers, solutions or suggestions you could send my way.

    Thank you !

    Comme toujours, here is my contact information :

    1. Email : simonwhel@yahoo.com
    2. Phone : 718-777-7731

    The easiest times to reach me are in the mornings before 11:00 AM or in the evening after about 7:00 PM.

    All the best & talk to you soon … Simon.

  6. #6
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by simonwhelan View Post
    I entered ‘irb’ into the Terminal window and I got back :
    irb(main):001:0>
    I then entered :
    mysql -u root
    I got back :
    SyntaxError: compile error
    (irb):21: parse error, unexpected tIDENTIFIER, expecting kDO or '{' or '('
    from (irb):21
    from :0
    Ok, you aren't supposed to run those commands in irb, that would be like typing them into the address bar of Firefox. Run:

    /usr/local/mysql/bin/mysql -u root

    ... in a fresh terminal and I suspect you will get the results you want.

    You may have noticed that you have to type ...
    /usr/local/mysql/bin/
    ... before each mysql command to get results. This is because the mysql binary directory (/usr/local/mysql/bin/) is not in your environment's path. Google this problem (phrases like "set linux path" should work) and fix it and you will make things a little easier for yourself.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •