The tag has no usage guidance.

learn more… | top users | synonyms

578
votes
7answers
1.0m views

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 ...
14
votes
4answers
43k views

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 ...
8
votes
4answers
14k views

Test MySQL credentials from Linux command line?

How do you test MySQL credentials from the command line on a Linux server?
8
votes
1answer
1k views

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 ...
5
votes
4answers
5k views

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 ...
5
votes
1answer
65 views

Getting column information from the MySQL command line

I am trying to get all the columns from MySQL using bash scripting. I want them to be stored in an array. If I write it this way: mysql -uroot -pPassword1 "select column_name from ...
5
votes
1answer
11k views

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 ...
4
votes
1answer
3k views

How, if possible, can an .sql file be executed against an oracle database from a bash script

Is it possible to execute an sql file (a text file containing several SQL statements) against an oracle database from a bash shell command line (e.g. no graphical GUI and no interactive clients) ...
4
votes
1answer
2k views

Unattended install of SQL Server 2008 R2 cluster fails with error - “Illegal characters in path.”

I am trying to build an .ini file for unattended installations of SQL Server 2008 R2. I followed this blog post to build an initial .ini file: http://blogesh.wordpress.com/2008/09/23/silent-install-of-...
3
votes
1answer
137 views

Mongodb incremental oplog Dump not working

I am not able to take an incremental oplog dump. I am not getting any error messages the connection happens fine and also there is a operation recorded(shows up in db.currentOp()), but still nothing ...
3
votes
1answer
6k views

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) ...
3
votes
1answer
60 views

How to drop user@% on the MySQL CLI?

How to drop 'user'@'%' on the MySQL CLI using the mysql -e command? mysql -uroot -p -e "'myuser'@'%'"; This does not work.
2
votes
2answers
3k views

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: http://stackoverflow.com/questions/187438/want-to-change-pgsql-port ...
2
votes
1answer
5k views

How do you setup a new oracle instance from the commandline after having done a database software only install?

I'm trying to familiarise myself with the process for setting up new instances/databases from the commandline with the aim of building a tool for deploying databases. The process we are thinking of ...
2
votes
1answer
3k views

MySql command line cyrillic Iinsert result is corrupted

Have putty connection. Putty config : window-->translation-->remote character set-->utf-8 Launch command line MySQL client. Perform insert with cyrillic like: CREATE TABLE `category` ( `catName` ...
2
votes
1answer
2k views

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 ...
2
votes
1answer
405 views

Portable client tool to connect to SQL Server Express LocalDB and execute a query

I am running out of ideas on this little problem: I need to execute a query on a LocalDB database directly on user's computer. I do not want to install anything there and there is only .NET (4.5.2) ...
2
votes
1answer
1k views

How to obtain SQL feature list from the command line

Is there a command at the CLI or in PowerShell that will list the components installed for SQL? I'm looking for something like the Feature List you can get from running the discovery report from ...
2
votes
1answer
1k views

Oracle SQL Loader - load file where record is composed of “n” delimiters

How would you write a control file for Oracle SQL Loader that treats each record as being composed of 3 commas? I have read the documentation, however I cannot find how to handle this scenario, ...
2
votes
1answer
50 views

How can I detect the use of SQL Server replication on a server (all versions) preferably using PS or CMD

I am trying to find a way to detect if a customer has SQL Server replication on. This helps decide whether they can use Express (as they frequently request) and this is one of the blocking factors. ...
2
votes
1answer
6k views

Install by command line

I am using following command line to install SQL Server 2008 R2 but its not installing. Also, I am not getting any error or log in summary.txt. "D:\SQLEXPR32_x86_ENU (1).exe" /q /ACTION= Install /...
2
votes
1answer
75 views

Difference of write authorization on file system with mySQL

On my local mySQL (on CentOS 6 VM) database I wanted to export some data from the DB to a file like this: SELECT html FROM mytable WHERE lang = 'en' and id='KEY01' INTO OUTFILE 'key01_en.html' By ...
1
vote
3answers
5k views

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
1
vote
1answer
210 views

mysql: show which users have permissions to a DB

Is there a way to show all users that have permissions on a database? I'm looking for something like: > show_permissions_for_db <DB>; +----------+----------------------+ | User | ...
1
vote
1answer
185 views

Phantom Table in MySQL

Programmer here, be gentle. I'm working in a MySQL database with only a single table, as shown by show tables: mysql> show tables; +----------------------+ | Tables_in_widget_web | +--------------...
1
vote
1answer
20 views

Is there a way to set bind_address from command line in mysql 5.5 without restarting?

I made a modification to bind_address in my.cnf that knocked down a monitor. It has been repaired since, firewall allowing the monitor IP in. However, mysql is still running in its previous state ...
1
vote
2answers
37 views

Teach MySQL cli autocomplete to only list table names, not field names?

When starting to write a MySQL query, e.g. describe myt and hitting TAB, MySQL autocomplete will list not just the table names starting with myt (e.g. mytable), but all fields/columns of each matching ...
1
vote
1answer
96 views

Text-based interface for PostgreSQL?

I know that psql is an option, but I'm looking for an easier text-based interface for PostgreSQL. Something that's similar to what 'tig' is to 'git', or 'phpmyadmin' is to 'mysql' (but using the ...
1
vote
1answer
3k views

import CSV into mysql table via command prompt (MySQL 5.6.25)

I'm trying to load CSV's into a mysql database with this command: LOAD DATA LOCAL INFILE '\Users\userName\Downloads\tableName.csv' INTO TABLE tableName FIELDS TERMINATED BY ',' LINES TERMINATED BY ...
1
vote
1answer
1k views

Can't insert arabic text into mysql database using mysql prompt

I had a local table with arabic values.when exported i got the following query. DROP TABLE IF EXISTS `type`; CREATE TABLE IF NOT EXISTS `type` ( `bs_id` int(11) NOT NULL AUTO_INCREMENT, `types` ...
1
vote
1answer
5k views

Check only prerequisites when running runInstaller in silent mode

I want to check just prerequisites and generate a log without installing Oracle database. When I run the following command: ./runInstaller -silentvalidate -responseFile /0/grid/response/...
1
vote
1answer
315 views

How export a database based in a primary key of a table?

So, I'm trying to export all the DB structure of my MySQL db. Attached is my DB structure, I have more then this, but I want these tables only. Basically Tools relate to Factsheets and Factsheets ...
1
vote
1answer
293 views

Mysql 5.1.X How to upload data from dump file without the partitioning commands?

I need to upload data from a dump file (large one) that includes partitioning info into a database that doesn't support partitioning. How can I tell the mysql command line to ignore the partitioning ...
1
vote
0answers
18 views

Can you get the “CREATE” statement for a domain in PostgreSQL?

In PostgreSQL, for many objects like functions (among other things), there exists a way to get the CREATE command for that specific object (with functions you can use pg_get_functiondef(oid), for ...
1
vote
1answer
579 views

SQLPlus Command Line In-line Set Commands

I have the need to run linux command line direct query, including SET options. The query by itself runs fine. However, when I attempt to add set commands, it fails. (my alias 'db' connects to ...
1
vote
0answers
286 views

how to disable and enable SSIS package using commandline?

I have a scenario where SSIS packages are deployed at the customer's site and they have some data issues. Because of this we are developing new packages to fix the corrupted data. When my new ...
0
votes
1answer
9k views

Using postgres with the command line without pgAdmin

I started working with PostgreSQL and till now I only had issues with it ( pgAdmin3 issues the most ) now I work a lot with MySQL and sometimes on the command line by just doing mysql -u ... -h ...
0
votes
1answer
932 views

Close all connections to postgres without having a connection

I have a cron job that runs a script that connects to a remote postgres database that I do not administer. We are allotted a single connection and, on the occasion that I or a colleague log in to run ...
0
votes
1answer
56 views

connect to psql and run SQL command from command line

I'm trying to write a quick line in bash that will use psql to connect to a database and delete all entries in two tables: \connect some_db DELETE from some_table DELETE from another_table I'd like ...
0
votes
2answers
89 views

MySQL Command to Mass Change Specific DB from MyISAM to InnoDB and vice versa?

I have an mu WordPress database and I want to change it from MyISAM to InnoDB to test its performance. Which MySQL command/commands will do it for all of the tables instead of doing manually one by ...
0
votes
1answer
611 views

Passing passwords more securely to mysql utilities on the command line

This question is related to another question I subsequently asked here: Using the output from mysqldiff.exe to transform database2 to match database1. I have been trying to use mysqldiff.exe, part of ...
0
votes
1answer
304 views

How to change the output encoding of Oracle command line tools to UTF8?

I am using a german oracle 11.2.0g install, which has some command line tools communicating with some non-ascii characters (ü, ö, etc.). These are written out in iso8859-1 encoding, but I need them as ...
0
votes
1answer
109 views

Export .MWB to working .SQL file using command line

We recently installed a server dedicated to unit tests, which deploys updates automatically via Jenkins when commits are done, and sends mails when a regression is noticed > This requires our ...
0
votes
0answers
26 views

mysql: can not find a function being called

I am new to mysql and there is a function (or something similar) in existing functions in the db. While I compile using the function on my server if compiles fine, but does not compile in my local. It ...
0
votes
0answers
17 views

Is there anyway to check what is the PostgreSQL data directory programatically?

I'm doing an installer to my program and I'd like to check if the databases already exists in the computer. I do this in a horrible way, calling psql -lqt | findstr dbname. If someone knows a better ...
0
votes
2answers
28 views

How to run mysqldump from windows command prompt

I'm using non-install version of mysql5.1 on Windows. I have placed "mysql" folder under c:\ and it seems to work fine. But when I try C:\>mysql\bin\mysqldump.exe -u root -p mydatabase > c:\>...
0
votes
2answers
125 views

how to create 'root'@'localhost', after disappearing

for some unknown reason my 'root'@'localhost' account has disappeared from MySQL server. So in order to recreate it, I used my command line and logged in with a user called 'john91'. First, I checked ...
0
votes
1answer
161 views

To give a user all privileges except the 'Create user' privilege

My task is simple i want to create a user in MySQL server that has all the privileges but excluding the ability to create other users. I tried to create a user through the root account. then i gave ...
0
votes
0answers
44 views

Searching & deleting content that starts & ends the same, but has random text in between

So my Wordpress sites been hacked & spuriously created a load of content in the posts which starts with & ends with . The only trouble is that the bit in between is random hyperlinks. Any ...
0
votes
1answer
6k views

Importing a SQL Dump File through XAMPP's Command Line

A few days ago, I exported a .SQL dump file with all my databases, which is about 150MB. The thing is I cannot import it through phpMyAdmin since the file is way to big. I remembered there was ...