Connecting to mysql using command prompt

Hi i just want to know how can i use the command prompt for mysql. how to setup my command prompt to accept mysql commands, thanks and God Bless

You need to add the path to MySQL to your command line PATH variable. With windows:
http://dev.mysql.com/doc/mysql-windows-excerpt/5.1/en/mysql-installation-windows-path.html

With Mac, you can edit your ~/.bash_profile like so:


export $PATH=/path/to/mysql:$PATH

where /path/to/mysql is normally


/usr/local/mysql/bin/mysql

Then you need to run:


source ~/.bash_profile

from the command line.

Now you can invoke mysql like so:


mysql -u root -p[i]password[/i]

Where root is your username, and password is your password

Hi Sir, First i want to thank you for replying to my post, i read the article link that you sent, i just want to do that, but there is a warning there that multiple mysql machine is not good. i saw in my program list that i have some multiple sql servers, but this servers are from microsoft, is there anything wrong with that, i am really afraid to continue to proceed because of this,

Hmm, I’m not sure if I can really advise you on this. Mainly because I use Mac, and have never set up MySQL on a Windows machine.

If it were me, I would try it, and see how you get on, then post any issues you have on these forums. I can’t guarantee that this will not cause you issues.

Thank you sir for helping, its a big help, God Bless