Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
0 answers
210 views

How to use mongoexport with a dynamic variable for date on windows batch file?

Here is my working script: mongoexport --db db1 --collection Transaction --out C:\Users\Admin\transactionstats.json --query="{"PaymentDate":{"$gte":{"$date":"...
JRA's user avatar
  • 149
0 votes
0 answers
159 views

How do I retain command history for psql running within PowerShell?

I'm running the following version of psql psql (12.11) on Windows Powershell running on Windows 10. Within the same shell session, when I log in and out of psql, it doesn't retain the previous ...
Dave's user avatar
  • 733
0 votes
1 answer
4k views

In Postgres 12, how do I set a default schema when logging in using psql?

I'm logging in to my Postgres 12 (running on Windows 10) db using an alias, which resolves to PGPASSWORD=$DB_PASSWORD psql -U${DB_USER} $DB_NAME I would like to find a way to tell Postgres which ...
Dave's user avatar
  • 733
0 votes
1 answer
5k views

How can I create a mysql database (if it doesn't exist) or replace it (if it exists)?

My dump: mysqldump --host=localhost --user=root --password=whatever --single-transaction --routines --triggers --log-error=error.txt --databases mydatabase > out.sql My restore mysql --host=...
acgbox's user avatar
  • 157
0 votes
1 answer
5k views

Why can't I use command \i on psql? It says no such file or directory [closed]

I am trying to use command \i 'C:\Users\Public\person.sql'; on windows on psql. And it says C:UsersPublicperson.sql: No such file or directory Although file does exist. I tried to relocate file on ...
aslan95's user avatar
1 vote
1 answer
2k views

Upgrading Postgres 12 to 13: 'pg_upgrade.exe' fails

I'm attempting to upgrade a Postgres instance from version 12 to version 13, following the steps outlined at https://www.postgresql.org/docs/13/pgupgrade.html. From an elevated command prompt, I'm ...
Marc.2377's user avatar
  • 187
1 vote
1 answer
1k views

Cannot Reset MySQL password

I have been stuck on this for a long time, I tried to follow the instructions located here: https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html. When I run the commands I get this as my ...
K. Lok's user avatar
  • 13
1 vote
1 answer
172 views

can I exclude or delete .pem files in backup data myqdl?

I am making a backup of the mysql data folder. In this folder are the databases. The method I am using is described in this post which uses ROBOCOPY During installation, mysql (tested in 5.7.30) ...
acgbox's user avatar
  • 157
6 votes
3 answers
9k views

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 ...
Codename K's user avatar
0 votes
2 answers
6k views

How to create a new database in PostgreSQL 10 in Windows from batch file?

I am creating a batch file to create a new database in PostgreSQL 10. I used the following code, echo off cd "C:\Program Files (x86)\PostgreSQL\10\bin" psql "dbname=myDB host=localhost user=postgres ...
Codename K's user avatar
1 vote
1 answer
8k views

`"C:\xampp\mysql\bin"' is not recognized as an internal or external command,operable program or batch file [closed]

I am trying to access to mysql from windows command prompt by this command: "C:\xampp\mysql\bin" mysql -u root - p But it sayas: `"C:\xampp\mysql\bin"' is not recognized as an internal or ...
user3486308's user avatar
5 votes
1 answer
25k views

How can I check the path of my.ini, through the command line?

I would like to know, if possible, how to display (using the command line) the path to my.ini used by the server. I am using MySQL 5.6 inside a windows IIS. I have the following: Program Files\...
IgorAlves's user avatar
  • 337
0 votes
1 answer
1k views

How to programmatically find the PostgreSQL data directory?

I'm creating an installer for my program and I'd like to check if the database already exists in the computer. I do this by calling psql -lqt | findstr dbname. If someone knows a better way I`ll be ...
Leandro Lima's user avatar
3 votes
1 answer
19k 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 ...
TCulos's user avatar
  • 115
5 votes
1 answer
11k 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 ...
JonnyRaa's user avatar
  • 279
14 votes
3 answers
62k 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: https://stackoverflow.com/questions/187438/want-to-change-pgsql-...
Nick Hung's user avatar
  • 141
9 votes
5 answers
46k 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 ...
Celeritas's user avatar
  • 893