0

I recently downloaded mysql. What am I doing wrong when I source the bash file?

The path for my bashrc file is:

Users/Name/bashrc

(I moved it from a different location, can't remember from where, but I figure that if the path is right, it shouldn't matter)

In the terminal, I'm supposed to use:

source ~/.bashrc 

When I type that and press enter, it returns:

-bash: /Users/Name/.bashrc: No such file or directory

The bash file itself says:

source /etc/bash.bashrc
source ~/.bashrc
export PATH=$PATH:/usr/local/mysql/bin
10
  • 1
    .bashrc is not the same file as bashrc
    – economy
    Mar 25, 2019 at 20:05
  • Using bashrc returns similar: -bash: /Users/Name/bashrc: No such file or directory
    – ngo
    Mar 25, 2019 at 20:11
  • 1
    what does echo $HOME return? Mar 25, 2019 at 20:12
  • 1
    Wait, are you saying in your last paragraph that your .bashrc contains the line source ~/.bashrc? If so, remove that line.
    – 0x5453
    Mar 25, 2019 at 20:16
  • 1
    @ngo There's your problem. bashrc.sh != .bashrc.
    – 0x5453
    Mar 25, 2019 at 20:19

1 Answer 1

1

You need to have the file .bashrc located in ~ to be able to source it. ~ expands to $HOME (/Users/Name in your case).

If the output of cd ~ && ls -la doesn't contain .bashrc, then you don't have that file, so you cannot source it.

Based on your comments, your file is ~/bashrc.sh (not a great name). If you delete the first two lines of this file, it will work properly. Note that you'll have to source this file every time you open a new terminal. You can add the line

export PATH=$PATH:/usr/local/mysql/bin 

to a file that gets automatically sourced upon login, like ~/.bash_profile, /etc/bash.bashrc (not recommended), or create a ~/.bashrc and include that line.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.