0

I'm new to using the terminal and I'm having trouble troubleshooting the following issue: After looking at some other similar problems I've tried the following commands that might enlighten you to what is wrong. First I'll post a summary of the things I've tried in the terminal and the responses I got from the terminal. Below that I'll "briefly" write about installation process and workbench issue.

(MyUserName)$ sudo ln -s /usr/local/mysql/bin/mysql usr/local/bin

Password:

  • (I input my Mac password here)*

ln: usr/local/bin: No such file or directory

Sometimes I get "No such file or directory" but sometimes I get the following:

(MyUserName)$ sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin

ln: /usr/local/bin: File exists

  • I still can't access mysql though, even if I try straight after the "File Exists" reply. Perhaps I messed something up yesterday when I did the above command but forgot the "s" after the dash?

(MyUsername)$ ls /usr/local/mysql

LICENSE README bin data docs include keyring lib man share support-files

(MyUsername)$ echo $PATH

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local//bin

  • Something I tried because of similar questions*

(MyUsername)$ export PATH=$PATH:/usr/local//bin

  • I just got another prompt from the terminal and tried the following login after that:*

(MyUserName)$ mysql -u root -p

-bash: mysql: command not found

I have successfully installed mysql and workbench and used it with no problem, however I just factory reset my MacBook and when installing again, I'm having these problems. At first I noticed that the default shell in the terminal was zsh, and I changed it to be default bash because I wasn't sure the commands were the same, and I am learning from a video and he uses the bash shell.

When installing mysql, I was not allowed to change the path or change where it was installed, not that I would've done so, but perhaps that's weird?

I also did not get to choose anything else except the type of password and then setting the password. (I remember choosing which components or something when doing this before)

In workbench, my root server says it's running, when I try to make another connection everything seems normal except that there is no input field for the password. So I've tried making the connection anyway but when trying to use it, it asks me for a password, where my root password does not work.

I appreciate all the help I can get, I need this for my studies (Teacher couldn't help due to the OS). Please let me know if you have any suggestions, thanks :)!

1
  • To be clear did you install using Brew or the Mysql Installer? Commented Mar 17, 2020 at 12:23

1 Answer 1

1

Your command should have been:

sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql

Basically, the command does a symbolic link for the mysql binary in /usr/local/bin which is already in your search path. Alternatively you could have added '/usr/local/mysql/bin/mysql' to PATH

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

1 Comment

Thanks for you reply, I see the mistake I did there, but it still doesn't work if I do that: $ sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql Password: ln: /usr/local/bin/mysql: Not a directory

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.