Solved

mysql command not found (Mac issue?)

Posted on 2009-07-03
7
862 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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…

856 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