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.

Filter by
Sorted by
Tagged with
0
votes
0answers
38 views

sqlcmd command doesnt work in bat file [closed]

I have a strange problem. I want to do backup of my data bases via sqlcmd command. If I write all command directly at cmd, everything works properly. If I save it as bat file and run I have error. Why?...
0
votes
0answers
39 views

SQLite3 column truncation even though column is wide enough

I have a table with schema CREATE TABLE test(id INTEGER NOT NULL PRIMARY KEY, numbers TEXT); and values INSERT INTO test(numbers) VALUES('1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,...
2
votes
2answers
50 views

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 ...
0
votes
0answers
130 views

Syntax error near & and : in psql

I am getting below errors in sql log of Native Postgres database : psql.bin:G_co-ac_G_grant_ivspc.sql:1: ERROR: 42601: syntax error at or near "&" 2 LINE 1: grant select on ...
0
votes
0answers
15 views

Import table data using multiple sql file in psql

Local Machine(l1): Windows 10 psql Remote Machine(R1): linux EDB(postgres) On my local I have 1000+ sql script containing insert statement . psql is also installed locally . I need to run this sql ...
0
votes
1answer
23 views

How to load data from another sql file into a main sql file? - MYSQL

I am trying to process the scripts dbcreate_f.sql and dbload_f.sql to create and to load data into a script solution6.sql. I am doing this in MYSQL command line. In solution6.sql I have two statements:...
1
vote
1answer
24 views

How can I ONLY get the query execution time on the command line without waiting till the data is displayed?

I am testing and comparing execution times of queries with big result sets using the command line. It takes too long to display the result set! Is there any way to see only the query execution time ...
1
vote
1answer
18 views

Is there a difference between running the source command from the mysql command line client and '<' from outside it? if so, when should I use each?

I can run the following commands: C:\myfolder>mysql -uuser -ppassword Then from within the client do: mysql>source C:\path\to\file.sql Or I can do: C:\myfolder>mysql -uuser -...
0
votes
0answers
12 views

Mismatch of postgresql versions

I installed rh-postgresql12 in my server. These are the steps I used to install and enable it and its dependencies : Installation : yum -y install rh-postgresql12 rh-postgresql12-postgresql rh-...
1
vote
1answer
14 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) ...
0
votes
1answer
204 views

PowerShell script to send an email with SQL results in HTML format

Does anyone have a PowerShell script to query results from a SQL Server database and send it out as an email in HTML format?
0
votes
0answers
16 views

How to stop results from Impala query on command line

Say I run this query: select db_name from mygianttable in the Impala command line (impala-shell) and it returns 150,000 rows. Is there a way to abort/stop the results from showing? I tried pressing ...
0
votes
0answers
13 views

SQL Azure Datawarehouse Automation Tasks

Today I had to create 3 LOGIN, 3 role, a 6 schema on Datawarehouse. It took 1 hour and 177 Lines of code, it's too much don't you think? CREATE LOGIN [CUSTOMER_BATCH_DEV] with password = '**********...
2
votes
1answer
350 views

Need help trying to run a batch file from a SQL Agent job

I am trying to run a batch file from a SQL Agent job. This batch file is a connection command and script file that will run. I can run the the actions straight from Command Prompt, but I need it to be ...
1
vote
2answers
2k views

How to print results in SQLcmd window

I'tm trying to show in SQLcmd window the results of these queries: SELECT SYSDATETIME() AS "date"; PRINT 'EXTRAÍDO POR:' SELECT SUSER_NAME() AS "Owner" PRINT 'PASSWORD SETTINGS'; exec ...
-1
votes
1answer
39 views

Problems running Postgres “createuser” command

I'm trying to run the createuser command on an MacOS 10.15 installation of Postgres 11.6. I have enabled root but there is no postgres user to su as - there's a _postgres user instead: dd@finglas:~ $ ...
0
votes
1answer
71 views

How do I skip an offline database over the network in MySQL import?

I am doing a MySQL import from an *.sql file to multiple database location over the network. I'm using cmd batch file to run the command and it's working as I expect it to be. However I notice that ...
1
vote
0answers
304 views

Is it possible to reset SA password without stopping SQL Server Service?

I lost a password for sa account. Now I want to reset SA password and at the same time not to restart SQL Server Service or going into single-user mode. I would like to mention that I am windows ...
0
votes
1answer
37 views

Trying to run lines on a timer

One of the things I need to do on my job is run lines of SQL code. I need to do each line individually. Which involves highlighting one line, executing it, then doing the next. Sometimes it is up ...
1
vote
0answers
81 views

How to enforce ON DELETE RESTRICT on MySQL?

This is my SQL code: -- DROP the database if it exists DROP DATABASE IF exists labtest; -- CREATE THE DATABASE CREATE DATABASE labtest; -- SHOW DATABASES; SHOW DATABASES; -- Use the database USE ...
0
votes
0answers
39 views

MariaDB pipped querys not executed

I experience a strange problem on our 3 node MariaDB cluster (10.2.24). Queries send over the command line are received by the cluster but don't get executed. MySQL does not return any errors or ...
1
vote
1answer
339 views

MySQL Error: Data Too Long For Column CHAR(5) - MariaDB 10.3.10 [closed]

When inserting data from CSV to MariaDB 10.3, the following error is generated while trying to insert value '00010' into NCHAR(5) column ERROR 1406 (22001): Data too long for column '...
0
votes
1answer
467 views

Mysql Command line Parameter passing to sql file

In windows mysql(5.7 version), I want to run mysql commmand using command line for .sql file as input . Also i was to pass some variable whose value should get used in .sql file. somehow I am not able ...
1
vote
1answer
130 views

How to tell whether mysql was built with libedit or readline?

How to tell whether mysql was built with libedit or readline? I'm trying to configure the mysql client tool to use Ctrl-R for searching command history but not sure which input library my ...
0
votes
2answers
3k views

how to stop OracleRemExecServiceV2 from cmd?

I have Oracle 12c running on Windows 7. When I look at the Oracle's specific services (Control Panel\System and Security\Administrative Tools\Services), I have the following 6 services: So far, ...
3
votes
1answer
722 views

How do I force windows to use a specific version of SQLCMD?

I have several versions of SSMS installed on my machine. We have legacy servers running several versions of SQL Server, mainly 2008, 2012, and 2014. I use SQLCMD all the time, but it seems to default ...
1
vote
1answer
2k views

How to format the output of SQL queries on SQLCMD for SQL Server 2017 on RHEL Linux 7.3?

I have installed SQL Server 2017 on RHEL Linux 7.3, and using SQLCMD utility for querying the SQL Server. When I try to query for example: 'SELECT * FROM SYS.DATABASES'. I get output like the ...
0
votes
1answer
257 views

How to get useful error information from mysql command?

I'm trying to script the creation of a database with tables. I'm encountering errors but the error messages are not helpful to me because I'm a novice. I'm finding the mysql tool is providing mostly ...
0
votes
1answer
337 views

How to deploy install of MS SQL Server 2017 Developer Edition via command-line script - not working

I'm trying to deploy MS SQL Server 2017 Developer Edition via command-line script from a server share that holds the install media onto Windows 10 1803 (June release). However, I'm not having much ...
0
votes
1answer
11 views

Show cassandra help documentation in terminal instead of browser

I've just started playing around with Cassandra through the cqlsh cli. When using the help command for the topics the documentation opens in the browser. Is there a way to show the documentation in ...
0
votes
1answer
63 views

mysql (5.5.) cmd unresponsive when selecting a huge db

I had initiated on Friday night a huge (~800G) dump from my machine to a remote host; Today, (although the command does not seem to have returned yet), I am able to log in to the machine and mysql ...
0
votes
1answer
71 views

How to prevent informational messages from getting written when query results are output to a file

When I am running the below query as a batch file (.BAT) using the Windows Task Scheduler, I am getting some informative messages in the output file DatabaseNames.txt in addition to the database names....
2
votes
3answers
3k 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 ...
0
votes
1answer
4k 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 ...
1
vote
1answer
3k 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 ...
0
votes
1answer
2k views

How to grant all privileges to a user from root user in MySQL on command line

I want to execute a command as root to grant privileges to a certain user to a certain "empty" database. I have tried many attempts and cannot get the syntax to work: mysql --host=localhost --user=...
0
votes
1answer
196 views

sqlite3 - table_info looks messy

I created a new database by using the command line binary on Suse. After activating headers by using .headers ON it still looks messy when getting table information with PRAGMA table_info(TABLE1);: ...
5
votes
2answers
5k views

How do you write to a folder with spaces in it?

I've got a bunch of simple SSIS packages that output SQL data to excel, then I rename the files and move them out to the end user. Some of them use file paths with spaces in them, and they aren't ...
-1
votes
1answer
488 views

SQLITE3 Commandline Tool SQL UPDATE Query syntax problem

I have two databases with identical table structures Dest.db = main Source.db = src the table is called colorramp structure of colorramp is ID | name | xml | favorite main.colorramp needs ...
4
votes
3answers
2k views

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

CREATE USER when user already exists

I use this code to create a user: CREATE USER "${domain}"@"localhost" IDENTIFIED BY "${dbuserp}"; CREATE DATABASE ${domain}; GRANT ALL PRIVILEGES ON ${domain}.* TO "${domain}"@"localhost"; But what ...
0
votes
1answer
323 views

Interrupting query sends wrong thread ID

In the MySQL command line client (Linux) when I kill a query by pressing CTRL+c this usually works fine. mysql (slave) > select sleep(5); ^CCtrl-C -- sending "KILL QUERY 117920686" to server ... ...
1
vote
1answer
220 views

Missing commands in MySQL command line history

Why aren't all command that are entered in the MySQL command line saved in the command history? For example, entering the commands DROP DATABASE mydb; CREATE DATABASE mydb DEFAULT CHARACTER SET utf8;...
1
vote
0answers
1k views

All instances upgrade from Command Prompt

I want to create a cmd script to upgrade sql servers in the organization(mostly 2014) to 2016. I've read Microsoft documentation Install SQL Server 2016 from the Command Prompt regarding this issue. ...
1
vote
2answers
623 views

Import error from mysql command line

I tried so many ways to restore a sample database (with the command on top of the picture) but i failed every single time. i successfully restored with this command in past. but now i am facing this ...
0
votes
0answers
420 views

Is there any way to set the alias for command permanently in PostgreSQL?

I'm trying to set the alias for command permanently in PostgreSQL. I've set the alias for a command like given below. Test=> \set x '\\! reset' So, the alias has set for reset the terminal. While ...
1
vote
0answers
588 views

Install SQL Server 2014 without SQL Server 2012 Native Client Tools

I am trying to install SQL 2014 through command line (via my installer setup to be precise). Below is the INSTALL Command I use for a silent Installation of my SQL Server. InstallCommand="/ACTION=...
1
vote
0answers
27 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
2k 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 ...
2
votes
1answer
549 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. ...