Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2002
    Location
    Nottingham, UK
    Posts
    37

    Unanswered: unix mapping for mysql

    This is a basic unix/linux/mac os x question.

    I am trying to set up a development environment locally on my powerbook for apache/php/mysql.

    On the remote server I am able to ssh connect (using terminal.app) and then run mysql like so
    >mysql -umyname -p
    password: *******

    but locally on my powerbook, I have to type the following to run mysql:
    >/usr/local/mysql/bin/mysql -umyname -p
    password: *******

    What I want to know is how do I map a shell command (for all users would be fine) so that I only have to type the former to start mysql?

    Thanks,

    Greg
    ----
    system:
    Mac Powerbook 1GHz

  2. #2
    Join Date
    Mar 2004
    Posts
    10

    Path

    This is a matter of setting your "PATH."

    Type the following on your powerbook:
    "echo $PATH"

    You should get some output like:
    /bin:/usr/local/bin:/usr/sbin

    Note: the colons separate the directories.

    on your powerbook, check this line for:
    /usr/local/mysql/bin:

    If you are connected locally you won't be able to find it.

    If you are connected remotely, you should be able to find it.

    In order to set your PATH, you can do it two ways: temporarily or permanently.

    temporarily:
    at the command line, type "echo $PATH".

    You should see something like the following:
    /bin:/usr/local/bin:/usr/sbin

    Now, type the following at the command prompt:
    "export PATH=$PATH:/usr/local/mysql/bin"

    You have now added a directory for the OS to look in for finding the MySQL binary.

    The permanent way:

    locally, go to your home directory.
    type: "ls -a."

    For a Linux Bash Shell, you would have a file named ".bash_profile".
    This is a file that executes each time you login w/ your username.
    Open this file, and you'll see the same PATH variable that you set above.
    Change this so that it points to the same directory the MySQL binary is in.

    Hope this helps.

  3. #3
    Join Date
    Jan 2002
    Location
    Nottingham, UK
    Posts
    37

    cant find it

    Hi,

    There is no .bash_profile in my home directory (max os x shell). I have the following beginning with a dot:

    .
    ..
    .lpoptions
    .mplayer
    .CFUserTextEncoding
    .mysql_history
    .DS_Store
    .ssh
    .MCXLC
    .viminfo
    .Trash
    .dvdcss
    .eclipse-platform
    .irssi
    .java
    .jpi_cache

    and then some others that dont' begin with a dot, like Library, Movies, Pictures, etc.
    ----
    system:
    Mac Powerbook 1GHz

  4. #4
    Join Date
    Jan 2002
    Location
    Nottingham, UK
    Posts
    37

    error in temporary solution too

    Also, for the "temporary" solution, I got an error in the terminal.

    // begin my terminal view

    ~greg: export PATH=$PATH:/usr/local/mysql/bin
    tcsh: Bad : modifier in $ (/).

    // end terminal view

    any feeback is appreciated, thx!
    ----
    system:
    Mac Powerbook 1GHz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •