I quickly scanned this thread, please excuse me if I missed anything, or anything I say has already been mentioned
.
I don't know if you resolved the "ERROR 1044: Access denied for user: '@localhost' to database 'sandwiches'" error, but basically it means that you are not using a valid login/password. In your case, you didn't specify either, so that's why you're getting the error.
I recommend using phpMyAdmin for setting up MySQL users (
www.phpmyadmin.com), because it makes everything much simpler.
Next; 'localhost' is just how any 'server' (in this case the MySQL server) refers to itself. You can set the server to respond to other addresses as well via something such as phpMyAdmin, but 'localhost' is just one automatically set up.
On the Mac version of MySQL, there is usually also a server called '[insert computer name here].local'. My computer is called 'apollo', so my address is 'apollo.local'. This is *an* address that other computers (in this case, I believe only other computers on your local network, because of the '.local') can use to access the MySQL server.
To recap: if you are going to be accessing the MySQL server from the same computer it's set up on, then you can just use 'localhost', otherwise you need to use some other address.
Now, the catch with this is that each different 'server address' requires that you set up separate usernames. For example, if I set up 'dlloyd@localhost', then I can use this username only if I am connecting to the server address 'localhost'. If I try to use it with 'apollo.local', the MySQL server won't recognize it.
Your current problem is that the shell doesn't know what to do when you type 'mysql'. The following is a copy from Mark Liyanage's website (
http://www.entropy.ch/software/macosx/mysql/)
If you do not want to have to type /usr/local/mysql/bin in front of every single mysql-related command, then you have to add the /usr/local/mysql/bin directory to your PATH environment variable in your shell's login script.
For the tcsh shell, which was the default up to Mac OS X 10.2 , you can do this by running this command once:
echo 'setenv PATH /usr/local/mysql/bin:$PATH' >> ~/.tcshrc
For the bash shell, which is the default for new user accounts created under Mac OS X 10.3, the command is:
echo 'export PATH=/usr/local/mysql/bin:$PATH' >> ~/.bash_profile
Then you have to close and re-open the terminal window.
After you do this, you should just be able to type the MySQL commands ('mysql', 'mysqladmin' etc.) without anything else before them and they will work properly. Note that you MUST close and reopen the terminal window before this takes effect. If you are not sure which shell you're using, it should say in the titlebar ('Terminal - [shell type] - [some other info]').
Hope this helps!