Question

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

students 

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

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top