MadsterMaddness
MadsterMaddness

Reputation: 735

How to use/select a MYSQL database on my desktop

I have a database file on my desktop that I am trying to open through my terminal.

my database is called: myDB.db

I tried using: mysql -u myDB.db -p

Thank you!!!


SOLVED for mysql! (Thank you Duffymo)

mysql -h localhost -u -p

>use [databaseName];

Also for sqlite you can do it this way:

sqlite3 [databaseName]
>.tables

Upvotes: 0

Views: 67

Answers (1)

duffymo
duffymo

Reputation: 308998

I use the command line this way:

http://dev.mysql.com/doc/refman/5.6/en/mysql.html

mysql -h localhost -u <admin user name> -p

I'm prompted for the admin or user password.

When I get into MySQL I specify which database I want to work with:

use X;

where X is the name of the schema I'm interested in.

At that point I can execute SQL commands.

Upvotes: 1

Related Questions