Changing a root password for SQL - sql

So i am running a linux box as well as WindowsServer2008. Right now i am trying to install barnyard to work on my linux machine, but i am stuck at a part in the process where linux asks for my SQL root password. This may be a stupid question but I am having difficulty finding where i would go to change the password for the SQL account. Both the WS2008 server and the linux are near-fresh installs with little on them but snort and MSSQL respectively. Any help would be greatly appreciated. Thank You!!

This should do the work on Linux:
#Stop mysql service
service mysql stop (RHEL based OS)
service mysqld stop (Debian based OS)
#Start mysql in safe mode:
mysqld_safe --skip-grant-tables &
#Log into mysql as root (No password is required)
mysql -uroot
#Select "mysql" database (where we need to make changes)
use mysql;
#Reset Password mynewpassword should be changed with password you wish to have
update user set password=PASSWORD("mynewpassword") where User='root';
#Flush privileges
flush privileges;
#Quit from mysql
quit
#Restart mysql service as normal mode
service mysql restart (RHEL based OS)
service mysqld restart (Debian based OS)

Related

TFS SSH task in Windows Machine failed

I tried to connect a Windows machine that exist in another domain than our TFS 2018.3 exist.
I added "SSH" task, and I created new SSH endpoint with the remote machine IP, username and password, without a private key. I configured in the remote machine access of SSH for this username & password.
In the SSH task, I configure a simple shell command: ls.
The TFS agent succeeded to connect the machine but failed with this error:
Unable to execute command or shell on remote system: Failed to Execute process.
Full log:
2019-08-15T13:22:54.1491966Z Trying to setup SSH connection to ********#myserverinanotherdomain:22
2019-08-15T13:22:54.4085564Z Successfully connected.
2019-08-15T13:22:54.8120684Z tr -d '\015' <"./sshscript_1565875374136" > "./sshscript_1565875374136._unix"
2019-08-15T13:22:54.8121422Z Unable to execute command or shell on remote system: Failed to Execute process.
2019-08-15T13:22:54.8121745Z
2019-08-15T13:22:54.8180230Z ##[error]Command tr -d '\015' <"./sshscript_1565875374136" > "./sshscript_1565875374136._unix" exited with code 4294967295.
I think because it's a Windows machine and I try to execute a shell script. If I will install Git bash, for example, it can help?
Does the SSh task support only Linux machines? if yes, how can I connect a machine that exists in another domain?
SSH being a communication protocol is agnostic of OS. It is not Linux specific. But there seems to be a limitation for using SSH task on windows machine/build agent. Take a look at this similar question here: Not able to run bash script from windows using vsts.
I haven't found a documentation that clearly declare the SSh task not support on Windows machine. But I have found a task which also uses SSH--Copy Files Over SSH task. And according to the Q&A in official link:
Is this task supported for target machines running operating systems
other than Linux?
This task is intended for target machines running Linux.
For copying files to a macOS machine, this task may be used, but authenticating with a password is not supported.
For copying files to a Windows machine, consider using Windows Machine File Copy.
Instead of SSH. You should be able to use a local account on the build server and when entering the credentials. The account must have the same password as the account in the other domain. In other works make sure build account which run on the build agent are able to connect another domain.
Also make sure there is a trust relationship between the domains.

How to start SQL Server 2017 on Linux in single user mode/ masteronly recovery mode?

How to start SQL Server 2017 on Linux in single user mode / masteronly recovery mode?
The scenario behind this question is we can move tempdb files to a new filesystem. What if I specify a wrong filesystem and restart SQL Server on linux. SQL Server will go down. In this case how to change tempdb location in system catalog?
If SQL Server is running, stop SQL Server:
sudo systemctl stop mssql-server
Switch to the user mssql. No password is required.
sudo su mssql
Start the SQL Server binary in single-user mode:
/opt/mssql/bin/sqlservr -m
Do whatever you need to do. When finished press CTRL-C
Start SQL Server:
sudo systemctl start mssql-server
Adding the -m flag when starting the process will enable single user mode.

Jenkins on unix executing script on windows server

I have a CI environment set up that build my project. It creates a set of sql server files, that i want to to send to my windows server. For that im looking into using scp, by installing copssh.
scp -r /file_in_unix/ user#windows_hostname:/cygdrive/c/
I want to execute a batch file on the windows server, but dont know how to do this?
any ideas?
Quite fast workaround is just to connect your Windows machine to Jenkins as another node. Your current unix job can trigger this job after successful execution.

Windows Environment variable passing through OpenSSH

I am using OpenSSH for Windows in order to be able to connect a Linux machine to a Windows machine.
To do that I have installed a SSH server for Windows v5.6p1-2.
I also have declared the allowed users.
From my Linux machine, I connect to the Windows machine with "ssh user#machine" command.
My problem is that once connected, I get only some Windows environment variables but not all system and user defined variables.
Is it possible to get all the Windows environment variables ?
Thanks,
"This is to limit security holes."
Check this out it has a few solutions.
http://cygwin.com/ml/cygwin/2006-11/msg00394.html

Where is SQL Server Express service?

I've installed SQL Server 2012 Express advanced edition on a clean (just OS without any third-party soft) w7x64 residing on VirtualBox 4.1.18. I’ve chosen every needed option to install, but after installation there is no SQL Server Express service running on guest OS on virtual machine. Also I have the same edition of SQL Server installed on my host OS which is also w7x64. Please give me any clues to what may be the cause of this issue.
Steps to diagnose:
Check in Control Panel -> Services that the SQL service is running
Try to connect from the local machine, type osql -E -S localhost\sqlexpress in a command prompt.