Shell command? | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Shell command?

UNIX for Dummies Questions & Answers


Tags
linux, linux commands

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-11-2006
tmallen tmallen is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 13 December 2006, 7:18 AM EST
Location: Arlington, VA
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Shell command?

I'm trying to reset my MySQL password in Terminal (OSX user) and am feeling my way through the process, as I know very little Unix. The guide I'm using suggests the following command as the final step:

shell> mysqld_safe --init-file=~/mysql-init &

to which Terminal responds (when I do it) with:
[1] xxxx
thomas-computer:~ root# -sh: shell: command not found

or something to that effect. substitue some numbers for the x (typically 1300-1500)

The method can be seen here:
http://dev.mysql.com/doc/refman/5.0/...rmissions.html

I've created the password file in the root directory, and have found the file I believe to be the correct .pid

What am I doing wrong? Can someone pleeease guide me through this?
Sponsored Links
    #2  
Old 12-11-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 22 August 2014, 12:12 PM EDT
Location: NM
Posts: 10,175
Thanks: 273
Thanked 785 Times in 734 Posts
I"m guessing somewhat - but I think the console is trying to use sh.

Like bash, and ksh, sh is a shell - that means it should be an executable named "sh"
that lives in /usr/bin

On some linux systems sh is a link (a kind of file that points to another file)

When you are at the command line in unix, post the output of these commands:

Code:
which sh
echo $PATH
ls  -l /usr/bin/sh

Sponsored Links
    #3  
Old 12-11-2006
tmallen tmallen is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 13 December 2006, 7:18 AM EST
Location: Arlington, VA
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
All of the commands I entered were preceded by:
thomas-computer:~ root#

which sh
yielded
/bin/sh

echo $PATH
yielded
/bin:/sbin:/usr/bin:/usr/sbin

and

ls -l /usr/bin/sh
yielded
ls: /usr/bin/sh: No such file or directory
    #4  
Old 12-11-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 22 August 2014, 12:12 PM EDT
Location: NM
Posts: 10,175
Thanks: 273
Thanked 785 Times in 734 Posts
Then for some reason your PATH is not finding the mysqld_safe part of the command.

try

Code:
./mysqld_safe --init-file=~/mysql-init &

Note the dot - slash at the start of the command.
Sponsored Links
    #5  
Old 12-11-2006
tmallen tmallen is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 13 December 2006, 7:18 AM EST
Location: Arlington, VA
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
This is killing me. I've been trying different methods for three days now, and still no luck. Part of the problem may be that the previous command has never been successful either:

shell> kill `cat /mysql-data-directory/host_name.pid`

because this hasn't worked (you can see it in the link from my original post) I've shut off the server using my preferences pane in OSX. In any case,

shell> ./mysqld_safe --init-file=~/mysql-init &

hasn't worked for me, unfortunately. I get the same old "-sh: shell: command not found" error.
Sponsored Links
    #6  
Old 12-11-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 22 August 2014, 2:59 PM EDT
Location: Ashburn, Virginia
Posts: 9,920
Thanks: 59
Thanked 430 Times in 256 Posts
thomas-computer:~ root# -sh: shell: command not found

My interpretation is that sh could not find some program called "shell".
Sponsored Links
    #7  
Old 12-11-2006
tmallen tmallen is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 13 December 2006, 7:18 AM EST
Location: Arlington, VA
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Can someone please guide me through the last few steps once more? I'm pretty sure I know the .pid file location, and I've created the text file the solution calls for. I simply can't get the final two steps to work... Can a Unix Guru please guide me through these final two steps? I'm running Mac OS 10.4 with the latest stable MySQL.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help with shell script: cp command not working, but mv command works... udelalv Shell Programming and Scripting 1 04-12-2011 04:34 AM
can anyone help with shell script command about searching word with grep command? aintour Shell Programming and Scripting 2 10-14-2009 04:51 PM
Need to Write Shell Script based off of this shell command Rally_Point Shell Programming and Scripting 3 06-10-2009 05:19 PM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr HP-UX 1 10-16-2006 04:16 PM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr Shell Programming and Scripting 0 09-19-2006 09:44 PM



All times are GMT -4. The time now is 03:37 PM.