A command line is a string given to a command interpreter that tells it actions to take, such as running programs or copying files. The interpreter processes command lines with escapes and substitutions.
Questions tagged [command-line]
115 questions
1455
votes
7 answers
How do I list all databases and tables using psql?
I am trying to learn PostgreSQL administration and have started learning how to use the psql command line tool.
When I log in with psql --username=postgres, how do I list all databases and tables?
I have tried \d, d and dS+ but nothing is listed. I…

Jonas
- 30,365
- 26
- 57
- 64
23
votes
1 answer
Is there a psql equivalent of bash's reverse-search-history?
I am very fond of bash's reverse-search-history (C-r) (command-line feature):
Search backward starting at the current line and moving ‘up’ through the history as necessary. This is an incremental search.
When I hit control-r in bash, I get the…

user664833
- 1,549
- 1
- 14
- 19
22
votes
4 answers
Test MySQL credentials from Linux command line?
How do you test MySQL credentials from the command line on a Linux server?

Jake Wilson
- 2,337
- 8
- 20
- 23
18
votes
2 answers
kill all queries - MySQL
Sometimes during a SNAFU I have to run kill query xxxxxxx twenty or thirty times. Any sort of kill all command I am missing?
On account of how I don't like typing.

JIStone
- 859
- 2
- 8
- 16
18
votes
4 answers
How can I unload Oracle database tables into a csv files?
I need to retrieve certain data from an Oracle 11g release 1 database and provide it as one or more CSV files. The data resides in multiple tables and/or views. All this should work via the command line.
What would be the best approach to this?

aPhilRa
- 183
- 1
- 1
- 4
14
votes
3 answers
Changing PostgreSQL port using command line
My PostgreSQL default port is 5432, I want to change default port by using command line (in Windows 7).
I saw this solution before: https://stackoverflow.com/questions/187438/want-to-change-pgsql-port
I tried running the following command, but it…

Nick Hung
- 141
- 1
- 1
- 3
7
votes
5 answers
Pg install: "The database cluster initialisation failed"
(Note: This question has been compeltely rewritten from its original form, so it reflects the actual problem and will help others find a solution to the same issue).
I still haven't been able to successfully install PostgreSQL on my Windows 7…

Celeritas
- 833
- 3
- 11
- 15
6
votes
4 answers
Why would I use the MySQL "system" command?
What can I do with the MySQL client's system command? Why does it exist?
The most productive use I've seen is to look around the file system (e.g., to remember the file name you want to SOURCE or LOAD FILE).
mysql> system ls /tmp
backup.sql
mysql>…

Jeremy Wadhams
- 868
- 1
- 9
- 13
6
votes
4 answers
Script Contents of SQL Server Database From a Batch File
I want to be able to script the schema of a given database into a .sql file from the Windows command prompt. Basically, I want to execute the "Generate Scripts" feature of Management Studio programmatically.
I know this is possible using .NET and…

usr
- 7,180
- 5
- 29
- 58
6
votes
1 answer
PostgreSQL: Change default port used by utilites like psql, createdb, etc
I have 2 instances of PostgreSQL running on some servers. One on the default port (5432) and the other instance on port 5433. Some users (and processes) only need access to the second instance (5433) and I'd like to set it up so that when those…

Meltemi
- 777
- 3
- 9
- 14
6
votes
3 answers
How do I test if MySQL "require secure transport" is working?
I activated the checkbox named "require secure transport" in the options file, found in the MySQL Workbench.
How do I know if MySQL "require secure transport" is working? Should I use command line at this point?

jehovahsays
- 353
- 1
- 3
- 6
5
votes
4 answers
How do you encrypt data while performing a mysqldump?
My OS is windows 7.
How can I encrypt data while performing a mysqldump?
From the command prompt, can I take a mysqldump with encrypted varchar and texts values?
Please help me.
Thanks

learner
- 163
- 1
- 1
- 4
5
votes
2 answers
How to Skip Existing Data While Restoring mysqldump File?
I use this query to import data using MySQL Dump (Command Prompt / Command Line)
mysql -u root -p database_name < database_name.sql
I want to import the large database (only new deltas) as of now I drop database and re-import but I want to import…

manigopal
- 51
- 1
- 3
5
votes
1 answer
How can you output UPDATE / INSERT query results when using MySQL -e,--execute?
When using MySQL to run an UPDATE or INSERT, I get query result info:
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
When using MySQL from the command line (eg: mysql -e "UPDATE ...") I get no output for successful…

originalbryan
- 153
- 1
- 3
5
votes
3 answers
How to prevent asking for password when creating new database in PostgreSQL 10?
I use the following batch file to create a new database in PostgreSQL 10.
echo off
cd "C:\Program Files (x86)\PostgreSQL\10\bin"
createdb -h localhost -p 5432 -U postgres myDB
But it asks to enter the password. How to prevent asking for the…

Codename K
- 189
- 3
- 8