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)

Shiva Krishna Bavandla
  • 25,548
  • 75
  • 193
  • 313

2 Answers2

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.

ojblass
  • 21,146
  • 22
  • 83
  • 132
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>

user2552751
  • 229
  • 1
  • 6
  • 18