Solved

mysql command not found (Mac issue?)

Posted on 2009-07-03
7
847 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
Comment Utility
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
Comment Utility
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
Comment Utility
what do you get when you run

find / -name mysql

which mysql
0
 

Author Comment

by:StephenMcGowan
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A lot of new and distinct gadgets are making their appearance every other day. The latest gadget that has wooed the attention of all gadget lovers and non gadget lovers alike is the Smartwatch. This tiny gadget is capable of offering live access to …
In this article we will discuss some EI Capitan Mail app issues and provide some manual process to resolve them.
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 video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now