Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

mysql command not found (Mac issue?)

Posted on 2009-07-03
7
Medium Priority
?
885 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 2000 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

688 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