Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Im prety sure i completely removed mysql from my system, except for one thing. When i type mysql in the command line i get this

bash: /opt/local/bin/mysql5: No such file or directory

How is it still recognizing where it thinks mysql should be? I'm trying to build it myself in /usr/local, and when i do install it there, i still get that error message for it looking for it in opt/local.

share|improve this question
    
ok i typed unalias mysql and it worked. Where are aliases stored ? Is there an .aliases file somewhere? –  mike Jun 8 '10 at 23:56
    
replacing the [mac-os] tag with the [osx] tag under the assumption that you are not running Mac OS 9 or earlier. –  quack quixote Jun 9 '10 at 12:12

2 Answers 2

Type

type mysql

on the command line; this will tell you where bash found mysql.

It might be that mysql's old path is simply cached. Try opening a new terminal first.

Update: If type tells you mysql is aliased to some place unter /opt/, then you'll have to remove the alias. Aliases have to be defined in the shell's startup files (if they were not set manually). So look through bash's startup files to find the alias setting. Bash has several startup files (see the Bash Reference Manual), look for one of:

  • profile
  • bashrc
  • bash_profile

They can either be in the user's home dir (name prepended with a .), or under /etc/ (under Linux, dunno where Mac OS X puts them).

share|improve this answer
    
i tried restarting the machine and it still happens. I get this $ type mysql mysql is aliased to `/opt/local/bin/mysql5' –  mike Jun 8 '10 at 23:52
    
If mysql is aliased as your comment suggests, the following should find it: grep -riI mysql ~ It searches all the text files in (and under) your home directory for the text. –  Pat Wallace Jun 9 '10 at 16:19

Alaises can be stored in a variety of locations. Within .profile, /etc/profile or any file that maybe sourced by the shell. Simply examine them by typing 'alias' at a system prompt.

  1. If you can not find the source for the alias - then from command line - 'unalias mysql'
  2. perform your install
  3. then create a new/updated alias in your own ~/.bashrc (the '~' represents your home directory)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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