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)
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:
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.
I have reviewed that page you linked and I think that I see the problem. The shell has a prompt to tell you to type something. The prompt is programmable and can be almost anything. It looks like your prompt might be "thomas-computer:~ root# ". There is no way that the author of that page could have predicted that. Now, in this line:
shell> kill `cat /mysql-data-directory/host_name.pid`
The "shell> " represents your shell's prompt. It is not something that you are supposed to type.
I ran both of these with the MySQL server off, as the instructions said. I am growing very frustrated! I still get "access denied" as root user in MySQL.
Ack! That is very dangerous. It has the same effect as:
cp /dev/null mysqld_safe
Assuming that you did not clobber your program, you need to figure out where mysqld_safe actually is. Then use the absolute path:
/this/that/the_other/mysqld_safe
Note that even if you have a directory called /this/that/the_other/ I am not implying that your mysqld_safe resides there. You need to replace /this/that/the_other/ with the correct directory.