Solved

.profile in Mac OS X with MySQL

Posted on 2009-07-02
6
427 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Binding MAC To Active Directory Domain 1 53
Outlook for Mac Meeting Rooms 2 29
bash while loop reading input from data section in script 7 65
Auto-rotate google map 1 64
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…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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 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 …

863 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

19 Experts available now in Live!

Get 1:1 Help Now