DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 11th July 2008
prakash512 prakash512 is offline
New User
 
Join Date: Jul 2008
Posts: 3
Thumbs up Please help as I am new to FreeBSD

Hai Friends,

I am just one day old in FreeBSD. I just installed it and am in facing big problem now. These are only some of my problems. Here beside the problems I am mentioning the output displayed when I use that particular command.

1. Wget command is not working. (wget: command not found)

2. export is not working (export: command not found)

3.locate is not working ( locate:database too small: /var/db/locate.database)

4.When I want to run a service and If i give the statement service xxx start then the output is again service : command not found

5. How can I get mysql package installed in the box now.

Please help me to solve these problems.

Thanks,
Prakash.
Reply With Quote
  #2   (View Single Post)  
Old 11th July 2008
ibutho ibutho is offline
New User
 
Join Date: May 2008
Posts: 4
Default

Hi and welcome to the forum.
  1. You can install wget by doing
    Code:
    #pkg_add -r wget
    or if you setup ports
    Code:
    cd /usr/ports/ftp/wget/ && make install clean
  2. AFAIK, export only works if you are using bash, zsh and similar shells. If you are using csh, then look at setenv.
  3. For locate, try running "updatedb" to update the database
  4. The service command is only for Red Hat based Linux distributions or their derivatives. Take a look here for info on how to start services.
  5. You can install mysql by doing
    Code:
    pkg_add -r  mysql50-server mysql50-client
    or if you configured ports
    Code:
    cd /usr/ports/databases/mysql50-server/ && make install clean

Go through the handbook if you need to find out more info about how to use FreeBSD.
Reply With Quote
  #3   (View Single Post)  
Old 11th July 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Default

Quote:
Originally Posted by prakash512 View Post
Hai Friends,

I am just one day old in FreeBSD. I just installed it and am in facing big problem now. These are only some of my problems. Here beside the problems I am mentioning the output displayed when I use that particular command.

1. Wget command is not working. (wget: command not found)
wget is a linux thing. Welcome to FreeBSD. Use "fetch"
Quote:

2. export is not working (export: command not found)
export is for sh family shells. If you are using a C family shell, then the command is "env", and works differently. You would probably feel more comfotable if you installed bash anyway: it's in the ports at /usr/ports/shells/bash . See man ports(7) for all the info on what ports are.
Quote:

3.locate is not working ( locate:database too small: /var/db/locate.database)
locate is run off a database: on my ubuntu laptop I get the same error because it is not filling the database for some reason. The system will run the database creation routine about 4:15 AM on Sunday mornings, but you can run it yourself by running "/etc/periodic/weekly/310.locate"
Quote:
4.When I want to run a service and If i give the statement service xxx start then the output is again service : command not found
What is this 'service' thing? Take a read of man rc(7) to find out how FreeBSD starts, stops and manages daemons. Hint: it's all done with scripts in /etc/rc.d and /usr/local/etc/rc.d, and the file /etc/rc.conf
Quote:
5. How can I get mysql package installed in the box now.
/usr/ports/databases/mysqlversion. Oh and take a look at /usr/ports/ports-mgmt/portmaster while you are there.
Quote:
Please help me to solve these problems.

Thanks,
Prakash.
I hope we have been helpfull.

By the way: FreeBSD is not linux. It is a different OS and predates linux. They are both superficially similar, as they both have roots in UNIX philosophies (and BSD is actually based on the ancient UNIX codebase), but they are different animals.
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.

Last edited by robbak; 11th July 2008 at 01:10 PM.
Reply With Quote
  #4   (View Single Post)  
Old 11th July 2008
18Googol2's Avatar
18Googol2 18Googol2 is offline
Real Name: whoami
Spam Deminer
 
Join Date: Apr 2008
Location: pwd
Posts: 283
Default

Quote:
Originally Posted by prakash512 View Post
3.locate is not working ( locate:database too small: /var/db/locate.database)
Your machine uptime probably is not long enough. afaik, the database will be updated in every Sat morning

Edit: more specific, it happens at 4 am. It can be checked with ls on the file

/var/db/locate.database

Last edited by 18Googol2; 11th July 2008 at 03:55 PM.
Reply With Quote
  #5   (View Single Post)  
Old 11th July 2008
lvlamb's Avatar
lvlamb lvlamb is offline
Real Name: Louis V. Lambrecht
Spam Deminer
 
Join Date: May 2008
Location: .be
Posts: 221
Default

man locate.updatedb
you run it as
Code:
sudo /usr/libexec/locate.updatedb
anytime you wish it updated.
It normally is on a cron and mostly runs once a week. But will not run if the machine is down at the specified time/date.
To prevent this, add anacron.

/var/db/locate.database must exist, touch if needed and chown root:wheel, chmod 444.
__________________
da more I know I know I know nuttin'
Reply With Quote
  #6   (View Single Post)  
Old 14th July 2008
prakash512 prakash512 is offline
New User
 
Join Date: Jul 2008
Posts: 3
Default

Hai,
First of all thanks to all. I worked on this. There are still some problems.
1. Locate did not work although i followed all the steps you have mentioned.
2. I installed mysql by following above steps. Now how can I access it. I mean to say that in Linux, If we give mysql then we can access mysql databases and tables. How can I do like that here.

Thanks,
Prakash.
Reply With Quote
  #7   (View Single Post)  
Old 14th July 2008
18Googol2's Avatar
18Googol2 18Googol2 is offline
Real Name: whoami
Spam Deminer
 
Join Date: Apr 2008
Location: pwd
Posts: 283
Default

Quote:
Originally Posted by prakash512 View Post
Hai,
First of all thanks to all. I worked on this. There are still some problems.
1. Locate did not work although i followed all the steps you have mentioned.
2. I installed mysql by following above steps. Now how can I access it. I mean to say that in Linux, If we give mysql then we can access mysql databases and tables. How can I do like that here.

Thanks,
Prakash.
1. dont just say "it doesnt work". If you want problem solved, tell us what you have done and error msg (if any). We are not mind readers.

2. mysql -u username -p db_name -h hostname(if any)
Reply With Quote
  #8   (View Single Post)  
Old 14th July 2008
prakash512 prakash512 is offline
New User
 
Join Date: Jul 2008
Posts: 3
Default

Hi,

I installed mysql package as told above. I executed both these statements.

pkg_add -r mysql50-server mysql50-client

cd /usr/ports/databases/mysql50-server/ && make install

I also find these are installed by giving the command "pkg_info | grep -i mysql"
the output of this command is

mysql-client-5.0.45_1 Multithreaded SQL database (client)
mysql-server-5.0.45_1 Multithreaded SQL database (server)

But when ever I type mysql (as we did in linux) i am not getting access to mysql (as in linux). How can i get this?

When ever i give mysql the output is

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Last edited by prakash512; 14th July 2008 at 06:18 AM.
Reply With Quote
  #9   (View Single Post)  
Old 14th July 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Default

You have not yet started mysql.

As you saw when you read the rc man page, mysql will be started on boot by /usr/local/etc/rc.d/mysql (or similar: I use postgres), if there are the required entries in /etc/rc.conf.

The messages that were displayed on the screen when you finished installing mysql would have told you how to start it. It will be something like this.
1. add a line like mysql_enable="YES" to /etc/rc.conf.
2. run, as root, /usr/local/etc.rc.d/mysql start (or similar - the script should be named mysql, but it might be slightly different.

re locate: If you run either of the programs /etc/periodic/weekly/310.locate or /usr/libexec/locate.updatedb (and there are no error messages), locate will work. If there are any error messages, you will need to deal with them. Tell us what they are, and we might just be able to help.
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
Old 14th July 2008
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 652
Default

One thing to keep in mind is that in many ways FreeBSD is the opposite of RH based systems. (I am guessing you've used a RH based one because you mention the service command--hrrm, maybe the others have it too, I don't know.)
At any rate, in many cases, in RedHat, when a program is installed, it's often set to start automatically in /etc/init.d. In FreeBSD, even when a program is installed, it is not set to run at startup.

To get it to run at startup, you'll look at the /usr/local/etc/rc.d script for the program--it will tell you what to enter in /etc/rc.conf to get the program to start.

It takes some getting used to but you might find that you like it better once you've adjusted to the differences.
Reply With Quote
Old 15th July 2008
Weaseal's Avatar
Weaseal Weaseal is offline
Package Pilot
 
Join Date: May 2008
Location: East Coast, US
Posts: 177
Default

Quote:
Originally Posted by prakash512 View Post
1. Locate did not work although i followed all the steps you have mentioned.
To my knowledge, the best way to update the database is to run the same script that is automatically run each Saturday;
As root:
# /etc/periodic/weekly/310.locate


And,
Quote:
Originally Posted by prakash512
I installed mysql package as told above. I executed both these statements.

pkg_add -r mysql50-server mysql50-client

cd /usr/ports/databases/mysql50-server/ && make install
Don't do that, it's completely redundant :P do one or the other.
__________________
FreeBSD addict since 4.2-RELEASE.
My FreeBSD wiki.

Last edited by Weaseal; 15th July 2008 at 08:35 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 08:45 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick