Questions tagged [command-line]

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.

116 questions
1500
votes
8 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
  • 31,495
  • 27
  • 59
  • 64
25
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,659
  • 1
  • 17
  • 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,377
  • 8
  • 21
  • 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
16
votes
5 answers

SQL Query Formatter

Are there any (Linux based) SQL Query Formatting programs/plugins/extensions? I use PostgreSQL and MySQL but other DB's are welcome as well. I can use a VM to test with but would prefer a Linux (Ubuntu) based solution. I have seen a online version…
Phill Pafford
  • 1,305
  • 5
  • 18
  • 25
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
  • 863
  • 3
  • 11
  • 15
7
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
  • 373
  • 1
  • 3
  • 6
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
  • 908
  • 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,240
  • 5
  • 30
  • 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
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
1
2 3 4 5 6 7 8