Solved

.profile in Mac OS X with MySQL

Posted on 2009-07-02
6
424 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
  • 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
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

 

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
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 previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

760 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

24 Experts available now in Live!

Get 1:1 Help Now