Solved

.profile in Mac OS X with MySQL

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

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.

Question has a verified solution.

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

In this article we will discuss some EI Capitan Mail app issues and provide some manual process to resolve them.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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 …

820 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