Solved

.profile in Mac OS X with MySQL

Posted on 2009-07-02
6
431 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

The error "There was an error performing the update" occurred on a Mac OS X client workstation running  Symantec AntiVirus for Mac (http://www.symantec.com/business/products/purchasing.jsp?pcid=pcat_security&pvid=825_1) - the Enterprise product vers…
Syslogd is a utility that traps and logs messages sent by running processes. It is configured with the syslog.conf file, which consists of lines containing a pair of fields: "the selector field which specifies the types of messages and priorities to…
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…
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.:

813 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

14 Experts available now in Live!

Get 1:1 Help Now