LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-11-2007, 08:34 AM   #1
jakobverner
LQ Newbie
 
Registered: Sep 2007
Location: Denmark
Distribution: Ubuntu
Posts: 10

Rep: Reputation: 0
Question Making mysql part of linux-environment


I have mysql installed in Fedora 7.

I want to make mysql a part of the environment, so linux knows the command mysql.

How do I do this?
 
Old 10-11-2007, 01:22 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
In the environment there is as variable called PATH. Note that is must be spelled with uppercase letters when refering to the variable.

The purpose of PATH is to contain a list of directories the shell will search through when looking for an executable.

The mysql executable is located in /usr/bin, which is probably not in the user's PATH, but is in the root users PATH. If you can su to root and start mysql, but cannot start mysql as user, then you must add /usr/bin you the user's PATH.

This is how to do it from the command line:
PATH=$PATH:/usr/bin
export PATH

That will add /usr/bin to the current value of $PATH. If you reverse the order (PATH=/usr/bin:$PATH) you will erase your current PATH, and will only have /usr/bin in the PATH.
 
Old 10-12-2007, 12:23 PM   #3
jakobverner
LQ Newbie
 
Registered: Sep 2007
Location: Denmark
Distribution: Ubuntu
Posts: 10

Original Poster
Rep: Reputation: 0
Great! This solved my problem for now, so thanks a lot and thumps up .
However when I reboot the path disappears and I have to add the Mysql path again.
How do I make it permanent part of my environment, so the path is added at boot?
 
Old 10-12-2007, 12:28 PM   #4
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
You can set your path in the .bashrc file
 
Old 10-14-2007, 07:39 AM   #5
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
mysql by default should be in the default path on most distro's. Did you happen to do a custom install and placed it elsewhere?
 
Old 10-15-2007, 01:24 AM   #6
jakobverner
LQ Newbie
 
Registered: Sep 2007
Location: Denmark
Distribution: Ubuntu
Posts: 10

Original Poster
Rep: Reputation: 0
I couldn't find MySql in this distro, which is an "Fedora 7 standart install" as the author described his published virtual appliance.

And yes I did make a custom install of mysql so the path I have to refer to is /usr/local/mysql/bin. I added this path to the file /etc/profile (which where refered to from the the file bashrc), and I now have mysql as a part of my environment even after reboot.
 
Old 10-15-2007, 09:15 AM   #7
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
If it was Fedora 7, probably a desktop type install then. A simple:

yum -y install mysql

Would have installed it for you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Making My Grandparents Leet Linux Users - Part 3 LXer Syndicated Linux News 0 08-22-2007 02:50 PM
LXer: Making Linux systems that don't suck. Part II LXer Syndicated Linux News 0 07-29-2007 11:16 AM
Making Windows+Linux environment raj_deep2k1 Linux - Networking 1 01-07-2006 01:04 AM
making Windows 2000 part of a Linux domain? wardialer Linux - Networking 1 02-24-2005 08:19 PM
Making shell script a part of linux image mayureshchitale Linux - Newbie 1 07-06-2004 01:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration