Solved

mysql command not found (Mac issue?)

Posted on 2009-07-03
7
873 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Set up iPhone and iPad email signatures to always send in high-quality HTML with this step-by step guide.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

635 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