Solved

.profile in Mac OS X with MySQL

Posted on 2009-07-02
6
440 Views
Last Modified: 2013-11-12
Hi,

I'm trying to run BioSQL and load my first database with MySQL:

"Starting BioSQL and loading the first database
------------------------------------

You have to first choose the language or project you want to use in
to load your data. You currently have three options: Perl and BioPerl,
Java and BioJava and Python and BioPython. You will need to download
the schema, the same for all three languages, and the supporting modules
for each language. In each case the package is a mixture of generic
modules for database access and then the BioSQL binding code.


Schema Loading
-------------

The BioSQL schema is distributed separately from the language
bindings. Use the svn checkout from the anonymous server:
svn co svn://code.open-bio.org/biosql/biosql-schema/trunk biosql-schema
Create a database, which we'll call 'biosql', in the data instance:

For MySQL do:
mysqladmin -u root create biosql"





I am going with the perl-Bioperl route. I have MySQL already installed in usr/local/mysql and i'm  now wondering how i can use MySQL to create the database 'biosql'.

when i type in:
bash-3.2# mysqladmin -u root create biosql

i receive:
bash: mysqladmin: command not found


I have been advised to change the $PATH in my .profile... but have no idea where this is, and how to change it to configure it to usr/local/mysql.

Any advice on this would be much 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
  • 3
6 Comments
 
LVL 12

Expert Comment

by:dalesit
ID: 24770951
You can put the full path in the command:

/usr/bin/mysqladmin -u root create biosql


If you need to find a program which is not in your path, you can always use the "locate" command

eg

[localhost:~] user% locate mysqladmin
/usr/bin/mysqladmin
/usr/share/man/man1/mysqladmin.1


Cheers,

Joel
0
 

Author Comment

by:StephenMcGowan
ID: 24772883
Hi Joel.

Since last posting.. i have changed my .profile to:

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

my mysqladmin is located in:

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


So the guide says:

The BioSQL schema is distributed separately from the language
bindings. Use the svn checkout from the anonymous server:
svn co svn://code.open-bio.org/biosql/biosql-schema/trunk biosql-schema
Create a database, which we'll call 'biosql', in the data instance:

For MySQL do:
mysqladmin -u root create biosql"


i have tried firstly:

bash-3.2# /usr/local/mysql-5.1.36-osx10.5-x86/bin/mysqladmin -u root create biosql

which returned nothing? unless biosql has been made and i just can't see it?



and for the second attempt i tried going into bash-3.2# /usr/local/mysql-5.1.36-osx10.5-x86/bin/

and in this directory i entered "bash-3.2# mysqladmin -u root create biosql".
which gave: bash: mysqladmin: command not found

Stephen.


0
 
LVL 12

Accepted Solution

by:
dalesit earned 500 total points
ID: 24773033
Possibly it has been made, if there was no error. For the second attempt, you should have put:

"bash-3.2# ./mysqladmin -u root create biosql"

You could try installing the MySQL gui...

http://dev.mysql.com/doc/administrator/en/gui-tools-installation-osx.html

Cheers,

Joel
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:StephenMcGowan
ID: 24773163
Hey Joel... one last thing :oP

I'm going to take it biosql has been created if no errors have come back, as you say.

The guide says:

For MySQL do:

  >mysqladmin -u root create biosql



To load the schema, use the appropiate SQL dialect in
biosql-schema/sql.

For mysql do:

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


i have entered the following shown below receiving the error message:

bash-3.2# mysql -u root biosql < biosqldb-mysql.sql
bash-3.2# bash: biosqldb-mysql.sql: No such file or directory

Stephen





0
 

Author Comment

by:StephenMcGowan
ID: 24773703
Sorry, to elaborate further:

As i have previously mentions, the guide i'm following states:

"To load the schema, use the appropiate SQL dialect in
biosql-schema/sql.

For mysql do:

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


I have the biosqldb-mysql.sql file saved in "/Users/stevey_mac2k2/Desktop/ExerciseTwo/biosql-1.0.1/sql/biosqldb-mysql.sql"

in Terminal, i have gone into the "/Users/stevey_mac2k2/Desktop/ExerciseTwo/biosql-1.0.1/sql/" directory and entered:

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

bash-3.2# pwd
/Users/stevey_mac2k2/Desktop/ExerciseTwo/biosql-1.0.1/sql

Any idea what i'm doing wrong with this?

Thanks,

Stephen.



0
 
LVL 12

Expert Comment

by:dalesit
ID: 24783486
This is the same issue, in that it can't find the binary mysql.

So, you would do

locate mysql

and then put in the full path to the command.

From your location before, I would guess that this would be

/usr/local/mysql-5.1.36-osx10.5-x86/bin/mysql < ./biosqldb-mysql.sql

assuming that you are in the directory where  biosqldb-mysql.sql is located.

Cheers,

Joel
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Do not see "Online Archive" Office 365 folder in MAC Outlook. 1 53
Outlook - Windows to Mac 7 53
Group By Function Required in PDF Output 21 64
Dual boot vs VM 11 130
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

737 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