Take the 2-minute tour ×

I have a very general question about unix. After using the ls command in the shell prompt, the following is listed


students is a database which i wanted to access. How to access and query this database? Should i use sudo su commands?

share|improve this question
This question would work better on Unix & Linux, or Superuser, rather than Stack Overflow. Anyway, you need to provide a lot more details. All we know is that there is some sort of file named "students" in some directory on your system, and you think it's a database of some sort. Please elaborate. –  Neil Forrester May 14 '12 at 16:44
add comment

1 Answer

up vote 1 down vote accepted

First you determine the database type, where it is located (host address), the username, and password to access it. The you determine if you have the appropiate client to connect to it. Then you connect and run your sql query.

Is this a sqllite or berkly db? Mysql?

If MySql, and you have the mysql client installed, and the db is on the localhost... do this:

mysql -u username -p

Where username is the username to connect. It will prompt for password. When at the mysql prompt see all dbs with this:

show databases;

Select a db like this:

use somedatase;

Then query away.

share|improve this answer
what does database type mean? All i know right now is the username and password. –  user1074122 May 14 '12 at 16:48
it is a mysql database –  user1074122 May 14 '12 at 16:49
add comment

Your Answer


