Chiel87

Q: Terminal: -bash: ‘export: command not found

Hi, can anyone help with the following issue?

 

I'm configuring a new MacBook for a website demo.

For installing MySQL i found a tutorial on the following website: *********

 

I coppied the command: echo ‘export PATH=/usr/local/mysql/bin:$PATH’ >> ~/.profile (with wrong quotes and see it to late)

Since then i got the following error when is start terminal: -bash: ‘export: command not found

 

Has anyone a solution for this?


<Link Edited by Host>

MacBook Air, Mac OS X (10.7), null

Posted on Dec 30, 2014 6:52 AM

Close

Q: Terminal: -bash: ‘export: command not found

  • All replies
  • Helpful answers

  • by nazaca,

    nazaca nazaca Nov 6, 2011 10:41 AM in response to Chiel87
    Level 1 (0 points)
    Nov 6, 2011 10:41 AM in response to Chiel87

    I am also confused when receiving this error on terminal start. 

     

    did you ever find an answer.?

  • by Denico,

    Denico Denico Nov 6, 2011 12:07 PM in response to nazaca
    Level 3 (670 points)
    Nov 6, 2011 12:07 PM in response to nazaca

    Hi ...

     

     

    do this in terminal:  (Without typo's  )

     

    echo $PATH

     

    and post the output here.

     

    /Dennis

  • by nazaca,

    nazaca nazaca Nov 6, 2011 1:24 PM in response to Denico
    Level 1 (0 points)
    Nov 6, 2011 1:24 PM in response to Denico

    thanks,

     

    i posted my question in the wrong place.

     

    what i was actually getting was -bash eport: command not found

     

    i found the problem i was having had to do with a modification of .bash_profile

     

    not sure why,  but i was intalling node.js and the .bash_profile  got modified and a "x" was removed. 

  • by bluepaua,

    bluepaua bluepaua Nov 7, 2011 12:44 AM in response to Chiel87
    Level 2 (185 points)
    Nov 7, 2011 12:44 AM in response to Chiel87

    Looks like you have found your solution. Going back to your original problem, always be careful when copying and pasting code from a website or a "fancy" document. I myself have been bitten many times when copying stuff off a Word document forgetting that stupid (or smart depending on your point of view) Word has converted all the simple quotes into fancy ones.

  • by Eduardo B1,

    Eduardo B1 Eduardo B1 Dec 29, 2014 8:59 PM in response to Chiel87
    Level 2 (469 points)
    Mac OS X
    Dec 29, 2014 8:59 PM in response to Chiel87

    I just love when someone starts an issue and other people just drop by and does not give the complete answer. Sure it helps a lot!

    The [server:~] root# echo $SHELL

    only gives to you

    /bin/bash

    ...and that does not answer the whole problem that is how to get rid of the terminal warning by finding out how to set the path to MySQL correctly. The same goes for;

    [server:~] root# echo $PATH

    /usr/local/mysql/bin:

    /usr/bin:/bin:

    /usr/sbin:/sbin:

    /usr/local/bin:/opt/X11/bin

     

    Anyway;

    I just setup the path to MySQL on Mavericks from a tutorial but when I opened the terminal to do some work this warning popped after I had logged in;

     

    "terminal, export: Command not found"

     

    So, I know that the path to MySQL on Mavericks is /usr/local/mysql/bin/

    Checking what I had in my ~/.bash_profile thru this command;

    [Server:~] root# grep export .bashrc -n

    gave me:

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

     

    Which was not right for some reason since the warning keep popping out. So, I decided to re-create the path and test afterwards by entering this command in the terminal;

     

    [Server:~] root# echo export PATH="/usr/local/mysql/bin:$PATH" >> ~/.bash_profile

     

    Since I had two more places to insert the path that by the way goes to these 3 different places;

     

    [Server:~] root# nano /Users/useryou/.bash_profile

    [Server:~] root# nano /Users/useryou/.tcshrc

    [Server:~] root# nano /Users/useryou/.bashrc

     

    So I went along to finish my other two paths by entering the command;

     

    [Server:~] root# echo export PATH="/usr/local/mysql/bin:$PATH" >> ~/.tcshrc

    [Server:~] root# echo export PATH="/usr/local/mysql/bin:$PATH" >> ~/.bashrc

     

    Then I checked the path by going to the actual file;

    [Server:~] root# nano /Users/useryou/.bash_profile

    The command had created this path;

     

    export PATH=/usr/local/mysql/bin:/usr/local/mysql/bin:/usr/local/mysql/bin:/usr/bin:/b in:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin

     

    Kinda of long path isn't? Well it works! How? You can find by testing if you can log to MySQL from the terminal;

     

    [server:~] root# mysql -u root -p

    Enter password:

    Welcome to the MySQL monitor.  Commands end with ; or \g.

    Your MySQL connection id is ?

    Server version: yourversion-log MySQL Community Server (GPL)

     

    Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

     

    Oracle is a registered trademark of Oracle Corporation and/or its

    affiliates. Other names may be trademarks of their respective

    owners.

     

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

     

    mysql>

     

    Worked for me and the Terminal did not gave me the warning "terminal, export: Command not found" any longer.

    I have no idea if the same works for Leopard, Snow Leopard or other Systems. You have to check it!

    Ps: By the way it should be obvious that you have to work all this as "root" or sudo to root.

  • by Leandro Igor,

    Leandro Igor Leandro Igor Sep 28, 2016 3:05 PM in response to Eduardo B1
    Level 1 (8 points)
    Mac OS X
    Sep 28, 2016 3:05 PM in response to Eduardo B1

    Good answer!

     

     

    I solved my problem regarding the MySQL error, but not the >> -bash: 'export: command not found << Help please Thanks in advance.

  • by BobHarris,

    BobHarris BobHarris Sep 28, 2016 5:05 PM in response to Leandro Igor
    Level 6 (19,672 points)
    Mac OS X
    Sep 28, 2016 5:05 PM in response to Leandro Igor

    Leandro Igor wrote:

     

    Good answer!

     

     

    I solved my problem regarding the MySQL error, but not the >> -bash: 'export: command not found << Help please Thanks in advance.

    The original post is 5 years old.

     

    If you wish to pursue the 'export' issue, I suggest you start a new "Post" (see "Post" button at top of this page), and describe your 'export' issue in detail, including posting the exact error message you are getting.

     

    You might also post the contents of the shell initialization script containing the 'export' command.

     

    Assuming you are running 'bash', then the following should tell us what version you are running

    echo $BASH_VERSION

    If nothing comes out, then you are not running 'bash' the default shell.

     

    If you are running the csh/tcsh shell, then

    echo $version

    should tell you the version.  And if running csh/tcsh, then the export command is not valid for csh/tcsh.

     

    Again, you should post this information in a new "Post"

  • by BobHarris,

    BobHarris BobHarris Sep 28, 2016 7:56 PM in response to Chiel87
    Level 6 (19,672 points)
    Mac OS X
    Sep 28, 2016 7:56 PM in response to Chiel87

    I coppied the command: echo ‘export PATH=/usr/local/mysql/bin:$PATH’ >> ~/.profile (with wrong quotes and see it to late)

    This is a badly formed command.  It is using the wrong kind of quotes.  PLEASE DO NOT USE IT.  It is what is causing the -bash: ‘export: command not found error message.


    If you want to add the mysql directory to PATH, please us the following:

    echo 'export PATH=/usr/local/mysql/bin:$PATH' >> ~/.profile

    There is a difference between ' and

    Bash knows ' is special, but is part of a smart-quote and from a syntax point of view, is just another character and is lumped in with export as a single 7 character token, that cannot be found in any name space that has a meaning to bash.