Solved

mysql command not found (Mac issue?)

Posted on 2009-07-03
7
863 Views
Last Modified: 2013-12-21
Hi,

I'm trying to load a schema for a programme called biosql.

I have created a database called "biosql" in MySQL, but i'm trying to load the biosql-schema/sql in MySQL with the command:

>mysql -u root biosql < biosqldb-mysql.sql

The "biosqldb-mysql.sql file is currently located on my mac in:
/Users/stevey_mac2k2/Desktop/ExerciseTwo/biosql-1.0.1/sql


I have created a .profile for my mysql commands with the script:

export PATH=/usr/local/mysql-5.1.35-osx10.5-x86/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:$PATH

i try the command:

bash-3.2# mysql -u root biosql < biosqldb-mysql.sql
bash: mysql: command not found

Any help would be greatly appreciated.

Thanks!
0
Comment
Question by:StephenMcGowan
  • 3
  • 2
7 Comments
 

Author Comment

by:StephenMcGowan
ID: 24774563
I think the issue is that when i type "mysql" the OS doesn't know where MySQL is located.

I currently have MySQL saved in the directory:

/usr/local

(folders in this location are mysql      and   mysql-5.1.36-osx10.5-x86


with the $PATH (in .profile) set as:

export PATH=/usr/local/mysql-5.1.35-osx10.5-x86/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:$PATH


Is there something i need to modify?

Thanks
0
 

Author Comment

by:StephenMcGowan
ID: 24774589
in fact i have mysql saved in /usr/local/mysql-5.1.36-osx10.5-x86/bin

with the $PATH (in .profile) set as:

export PATH=/usr/local/mysql-5.1.35-osx10.5-x86/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:$PATH

still receiving:

bash-3.2# mysql -u root biosql < biosqldb-mysql.sql
bash: mysql: command not found

:o/

0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24778979
what do you get when you run

find / -name mysql

which mysql
0
 

Author Comment

by:StephenMcGowan
ID: 24779174
bash-3.2# find / -name mysql
/Users/stevey_mac2k2/.cpan/build/DBD-mysql-4.012/lib/DBD/mysql
/usr/local/mysql
/usr/local/mysql-5.1.36-osx10.5-x86/bin/mysql
/usr/local/mysql-5.1.36-osx10.5-x86/data/mysql

0
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 total points
ID: 24779402
as you can see the path is to

/usr/local/mysql-5.1.36-osx10.5-x86/bin

while in

PATH=/usr/local/mysql-5.1.35-osx10.5-x86/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:$PATH

you are using

/usr/local/mysql-5.1.35-osx10.5-x86/bin

so change it accordingly
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We could spend the next millennium discussing the differences of the Mac and Windows platforms. The next century will continue to have fanatics on both side of the equation and neither side will win the war. However, that’s not why we are here. W…
Creating and Managing Databases with phpMyAdmin in cPanel.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question