3

I just installed mysql from this site, and was successful with that. But when i tried to open with command mysql -u root -ppassword on terminal it is showing -bash: mysql: command not found

But when i tried it like below i can able to login successfully in to mysql.

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

So what i should i make to use just mysql instead of /usr/local/mysql/bin/mysql. (By the way i am new to Mac)

2 Answers 2

1

You can update your .profile or .bashrc file to include the directory /usr/local/mysql/bin to your PATH variable. In addition you can create a symbolic link to a location already in your PATH variable.

Sign up to request clarification or add additional context in comments.

3 Comments

how to add that with export command ?, adding in to eigther of file is ok ?
export PATH=/usr/local/mysql/bin:$PATH it is better to add it to the bashrc file. I think .profile may be used for other shells.
I already have PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}" export PATH how should I added?
0

Just do the following in terminal:

Type cd

drag the path on to the terminal where the dmg exists

Type /usr/LOCAL/mysql/BIN/mysql -h host -u user -p

(host=hostname user=username to login to access database)

On giving valid credentials, you will be prompted for password

On giving valid password,it will be displayed with Welcome to mysql monitor and soon.. with the below prompt

mysql>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.