Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
1
answers
754
views
install/enable sqlsrv/pdo_sqlsrv php8.1 on AlmaLinux v9.4.0
The hostgator server updated the linux system from CentOs to Almalinux and now I need to install the sqlsrv drivers again as I only get the error could not find driver What I've done so far is move these 2 files to the **/opt/cpanel/ea-php81/root/lib64/php/modules** folder on the server **SQLSRV_8.1...
The hostgator server updated the linux system from CentOs to Almalinux and now I need to install the sqlsrv drivers again as I only get the error could not find driver
What I've done so far is move these 2 files to the **/opt/cpanel/ea-php81/root/lib64/php/modules** folder on the server
**SQLSRV_8.1_NTS.so**
**PDO_SQLSRV_8.1_NTS.so**
Then I put these 2 lines in php.ini
**extension=SQLSRV_8.1_NTS.so**
**extension=PDO_SQLSRV_8.1_NTS.so**
I restarted the server.
PHPinfo looked like this
The page that connects to the database only displays this message:
**could not find driver**
The PHP code is this:
$drive = 'sqlsrv';
$server = 'host.server.here';
$port = '1443';
$server = $port !== '1443' && is_string($port) ? $server .= ", $port": $server;
$database = 'name_database';
$user = 'user_here';
$pass = 'pass_here';
$pdoConfig = $drive . ":". "Server=" . $server . ";";
$pdoConfig .= "Database=".$database.";";
try {
if(!isset($connection)){
$connection = new PDO($pdoConfig, $user, $pass);
$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $connection;
}
}catch (PDOException $e) {
print_r($e->getMessage());
return null;
}


Maico Rossarola
(1 rep)
Jul 24, 2024, 12:05 PM
• Last activity: Jul 25, 2024, 11:26 AM
0
votes
0
answers
229
views
Why are my strings being truncated including and after an equals sign?
I was writing a shell script for inserting a string value through a Microsoft `sqlcmd` variable into a Microsoft SQL server database table and noticed some unexpected behavior. It appeared the trailing equals (`=`) character and everything after were being truncated (the target column had no charact...
I was writing a shell script for inserting a string value through a Microsoft
sqlcmd
variable into a Microsoft SQL server database table and noticed some unexpected behavior. It appeared the trailing equals (=
) character and everything after were being truncated (the target column had no character limit). In attempt to narrow down the source of the behavior, I wrote a simple Microsoft SQL script (test.sql
) that prints a sqlcmd
variable:
PRINT '$(PrintMe)'
And then tested it with the following command:
sqlcmd -S localhost -U sa -P password -v PrintMe='abc==' -i test.sql
To my surprise, the output was abc
instead of the expected abc==
.
At first, I thought this was sqlcmd
doing something strange with my variable value, but altering the script:
:setvar PrintMe "abc=="
PRINT '$(PrintMe)'
printed abc==
as expected.
Now it made me wonder if zsh
or bash
were misinterpreting those characters for some reason (e.g. as macros/expansions). Using a double-quoted value made no difference in the output. In fact, I noticed a variable value like abc=123
output just abc
, truncating everything including and after the equals. Trying to escape the =
character using a value like 123\=
output 123\
. After reading about [_zsh_ =
expansion](https://stackoverflow.com/questions/76902705/baffling-zsh-behavior-on-equal-sign-precedes-a-zsh-variable) , though I doubted it was the cause, I tried running unsetopt EQUALS
but saw no change in the output.
I ran these commands with [sqlcmd
](https://github.com/microsoft/go-sqlcmd) 1.6.0, _zsh_ 5.9 (x86_64-apple-darwin21.3.0) on macOS Ventura 13.6.6 and again with _bash_ 5.2.26(1)-release (x86_64-apple-darwin22.6.0) with no change in results.
Is there any explanation for what's going on here?
Mark
(101 rep)
May 13, 2024, 01:13 AM
• Last activity: May 13, 2024, 07:31 AM
0
votes
1
answers
2052
views
Install failed when installing PDO sqlsrv on debian 12 with PHP 8.3
I want to install `pdo_sqlsrv` on a Debian 12 server with PHP 8.3. I'm following the documentation available [here](https://learn.microsoft.com/fr-fr/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver16#installing-on-debian). The latest version seems to be perfect ([5.12.0](https://...
I want to install
pdo_sqlsrv
on a Debian 12 server with PHP 8.3. I'm following the documentation available [here](https://learn.microsoft.com/fr-fr/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver16#installing-on-debian) .
The latest version seems to be perfect ([5.12.0](https://github.com/microsoft/msphpsql/releases/tag/v5.12.0)) , but I can't install it. After doing this as the doc said:
apt-get install curl apt-transport-https
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
apt-get update
apt-get install -y php8.3 php8.3-dev php8.3-xml php8.3-intl unixodbc-dev unixodbc odbcinst
I'm doing this:
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
And I always have this error:
PHP Warning: PHP Startup: Unable to load dynamic library 'sqlsrv.so' (tried: /usr/lib/php/20230831/sqlsrv.so (/usr/lib/php/20230831/sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20230831/sqlsrv.so.so (/usr/lib/php/20230831/sqlsrv.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
No releases available for package "pecl.php.net/sqlsrv"
install failed
PHP Warning: PHP Startup: Unable to load dynamic library 'sqlsrv.so' (tried: /usr/lib/php/20230831/sqlsrv.so (/usr/lib/php/20230831/sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20230831/sqlsrv.so.so (/usr/lib/php/20230831/sqlsrv.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
No releases available for package "pecl.php.net/pdo_sqlsrv"
install failed
I also tried [this tuto](https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017&tabs=debian18-install%2Cdebian17-install%2Cdebian8-install%2Credhat7-13-install%2Crhel7-offline) from microsoft, but I got "Package msodbcsql17
not found"
I don't know how to install it. How can I fix it ?
Elikill58
(133 rep)
Mar 26, 2024, 09:16 AM
• Last activity: Apr 4, 2024, 02:19 PM
2
votes
1
answers
314
views
MSSQL database server on UNIX
I have heard rumors, but did not manage to find anything more, about some sort of MSSQL serving on UNIX machine, or MSSQL/MySQL server, that can handle MSSQL storage. I would like to know, if it is possible, and what are possible methods to achieve this.
I have heard rumors, but did not manage to find anything more, about some sort of MSSQL serving on UNIX machine, or MSSQL/MySQL server, that can handle MSSQL storage.
I would like to know, if it is possible, and what are possible methods to achieve this.
Deele
(293 rep)
Dec 26, 2011, 03:43 PM
• Last activity: Feb 27, 2024, 09:32 AM
2
votes
0
answers
1182
views
mssql service cannot start, after setup
After installing mssql-server, it successfully installs then on setting up it fails with the error below Step one - on setup it fails with the error below sudo /opt/mssql/bin/mssql-conf setup > Enter the SQL Server system administrator password: Confirm the SQL > Server system administrator password...
After installing mssql-server, it successfully installs then on setting up it fails with the error below
Step one - on setup it fails with the error below
sudo /opt/mssql/bin/mssql-conf setup
> Enter the SQL Server system administrator password: Confirm the SQL
> Server system administrator password: Configuring SQL Server...
>
> /opt/mssql/bin/sqlservr: error while loading shared libraries:
> liblber-2.4.so.2: cannot open shared object file: No such file or
> directory Created symlink
> /etc/systemd/system/multi-user.target.wants/mssql-server.service →
> /lib/systemd/system/mssql-server.service. Setup has completed
> successfully. SQL Server is now starting.
When checking the status i get this
freak@loyaltie ~
$ systemctl status mssql-server --no-pager
× mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Sat 2024-02-24 01:50:54 EAT; 32s ago
Duration: 7ms
Docs: https://docs.microsoft.com/en-us/sql/linux
Process: 10553 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=127)
Main PID: 10553 (code=exited, status=127)
CPU: 4ms
am using this operating system
$ neofetch
:oho/-
freak@loyaltie
`mMMMMMMMMMMMNmmdhy- --------------
dMMMMMMMMMMMMMMMMMMs` OS: Parrot Security 6.0 (lorikeet) x86_64
+MMsohNMMMMMMMMMMMMMm/ Host: 80YD Lenovo ideapad 320-14IKB
.My .+dMMMMMMMMMMMMMh. Kernel: 6.5.0-13parrot1-amd64
+ :NMMMMMMMMMMMMNo Uptime: 16 hours, 46 mins
`yMMMMMMMMMMMMMm: Packages: 2812 (dpkg), 18 (snap)
/NMMMMMMMMMMMMMy` Shell: bash 5.2.15
.hMMMMMMMMMMMMMN+ Resolution: 1920x1080, 1440x900
``-NMMMMMMMMMd- DE: MATE 1.26.0
/MMMMMMMMMMMs` WM: Metacity (Marco)
mMMMMMMMsyNMN/ Theme: air [GTK2/3]
+MMMMMMMo :sNh. Icons: ara-dark [GTK2/3]
`NMMMMMMm -o/ Terminal: vscode
oMMMMMMM. CPU: Intel i5-7200U (4) @ 3.100GHz
`NMMMMMM+ GPU: Intel HD Graphics 620
+MMd/NMh GPU: AMD ATI Radeon R7 M260/M265 / M340/M360 / M440/M445 / 530/535 / 620/625 Mobile
mMm -mN` Memory: 6609MiB / 11742MiB
/MM `h:
dM` .
:M-
d:
-+
-
There are fewer logs from the terminal and i think its just a misconfiguration of the "servr" statement?
skeeper
(21 rep)
Feb 23, 2024, 11:11 PM
• Last activity: Feb 27, 2024, 07:35 AM
0
votes
0
answers
357
views
How to Fix "MySQL error message was : DBI connect failed : Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) ?"
I upgraded my VPS with the provider Contabo, and since then, I have been experiencing issues. Unfortunately, they have not been responsive or provided any support. when i do command : service mysql start, it return The full MySQL error message was : DBI connect failed : Can't connect to local MySQL...
I upgraded my VPS with the provider Contabo, and since then, I have been experiencing issues. Unfortunately, they have not been responsive or provided any support.
when i do command : service mysql start, it return
The full MySQL error message was : DBI connect failed : Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) ?
Command : sudo systemctl status mysql , gives:
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2023-10-30 03:51:56 CET; 9s ago
Process: 4936 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
Oct 30 03:51:56 vmi891613.contaboserver.net systemd: mysql.service: Scheduled restart job, restart counter is at 5.
Oct 30 03:51:56 vmi891613.contaboserver.net systemd: Stopped MySQL Community Server.
Oct 30 03:51:56 vmi891613.contaboserver.net systemd: mysql.service: Start request repeated too quickly.
Oct 30 03:51:56 vmi891613.contaboserver.net systemd: mysql.service: Failed with result 'exit-code'.
Oct 30 03:51:56 vmi891613.contaboserver.net systemd: Failed to start MySQL Community Server.
I tried restart "*sudo systemctl start mysql* ", but shows:
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
the systemctl status mysql.service gives the same mentioned before.
if any one know how to fix this without losing my websites in the VPS, please help i have like 6 domians in this VPN and the service provider (Contabo) not helping. its been 48 hours and the financial losses continue to mount with each passing hour.
MD.Favaz
(1 rep)
Oct 30, 2023, 02:58 AM
• Last activity: Oct 31, 2023, 05:16 AM
2
votes
2
answers
2920
views
LDAP 2.5 breaks SQL Server on Debian 12
Resterted due to power cut and now SQL Server isn't starting because ``` /opt/mssql/bin/sqlservr: error while loading shared libraries: liblber-2.4.so.2: cannot open shared object file: No such file or directory ``` I found the files in `/usr/lib/x86_64-linux-gnu` and tried creating symlinks from th...
Resterted due to power cut and now SQL Server isn't starting because
/opt/mssql/bin/sqlservr: error while loading shared libraries: liblber-2.4.so.2: cannot open shared object file: No such file or directory
I found the files in /usr/lib/x86_64-linux-gnu
and tried creating symlinks from the files SQL Server wants to the files that exit but it isn't fooled:
/opt/mssql/bin/sqlservr: /lib/x86_64-linux-gnu/libldap_r-2.4.so.2: version `OPENLDAP_2.4_2' not found (required by /opt/mssql/bin/sqlservr)
Seems that I have LDAP libraries version 2.5 installed and SQL Server requires 2.4
# apt show libldap-common
Package: libldap-common
Version: 2.5.13+dfsg-5
Priority: optional
Section: libs
Source: openldap
Maintainer: Debian OpenLDAP Maintainers
Installed-Size: 94.2 kB
Replaces: libldap-2.4-2 (
2023-08-21 18:50:42 status half-configured libldap-2.4-2:amd64 2.4.57+dfsg-3+deb11u1
2023-08-21 18:50:42 status half-installed libldap-2.4-2:amd64 2.4.57+dfsg-3+deb11u1
2023-08-21 18:50:42 status config-files libldap-2.4-2:amd64 2.4.57+dfsg-3+deb11u1
2023-08-21 18:50:42 status not-installed libldap-2.4-2:amd64
2023-08-27 10:20:03 install libldap-dev:amd64 2.5.13+dfsg-5
2023-08-27 10:20:03 status half-installed libldap-dev:amd64 2.5.13+dfsg-5
2023-08-27 10:20:03 status unpacked libldap-dev:amd64 2.5.13+dfsg-5
2023-08-27 10:20:03 configure libldap-dev:amd64 2.5.13+dfsg-5
2023-08-27 10:20:03 status unpacked libldap-dev:amd64 2.5.13+dfsg-5
2023-08-27 10:20:03 status half-configured libldap-dev:amd64 2.5.13+dfsg-5
2023-08-27 10:20:03 status installed libldap-dev:amd64 2.5.13+dfsg-5
2023-08-27 10:23:13 install ldap-utils:amd64 2.5.13+dfsg-5
2023-08-27 10:23:13 status half-installed ldap-utils:amd64 2.5.13+dfsg-5
2023-08-27 10:23:13 status unpacked ldap-utils:amd64 2.5.13+dfsg-5
2023-08-27 10:23:13 configure ldap-utils:amd64 2.5.13+dfsg-5
2023-08-27 10:23:13 status unpacked ldap-utils:amd64 2.5.13+dfsg-5
2023-08-27 10:23:13 status half-configured ldap-utils:amd64 2.5.13+dfsg-5
2023-08-27 10:23:13 status installed ldap-utils:amd64 2.5.13+dfsg-5
Can it be undone?
**Update**
Same problem on Ubuntu 22.04.
Richard Barraclough
(550 rep)
Aug 27, 2023, 09:42 AM
• Last activity: Aug 27, 2023, 05:24 PM
3
votes
3
answers
2725
views
backup MSSQL database to a client's local disk over network
I'm trying to backup a `MSSQL` server from linux. I'm able to connect to the server using `tsql` (from the freetds project), and I'm even able to backup the database on the server using the backup database command, but I haven't been able to download this backup onto the machine I'm using to connect...
I'm trying to backup a
MSSQL
server from linux. I'm able to connect to the server using tsql
(from the freetds project), and I'm even able to backup the database on the server using the backup database command, but I haven't been able to download this backup onto the machine I'm using to connect to the MSSQL
server.
If this was a mySQL
server, I could download a backup of the database using mysqldump
. Is there something similar I can do for an MSSQL server in linux?
drizzle
(31 rep)
Mar 2, 2011, 06:35 PM
• Last activity: Jul 2, 2023, 09:43 PM
0
votes
0
answers
535
views
What is causing the error when trying to start mssql-server on Linux Mint using sudo /opt/mssql/bin/mssql-conf setup, and how can it be resolved?
This is the error that is popping up! I am trying to install sql server 2019. I read in one github question that this isn't an mssql-server error but something that has to do with the linux itself, or my device to be more specific, but still couldn't do anything about it. I would appreciate it a lot...
This is the error that is popping up! I am trying to install sql server 2019. I read in one github question that this isn't an mssql-server error but something that has to do with the linux itself, or my device to be more specific, but still couldn't do anything about it. I would appreciate it a lot if someone helped me with this. Thanks!
This program has encountered a fatal error and cannot continue running at Sat Mar 25 01:30:57 2023
The following diagnostic information is available:
Reason: 0x00000001
Signal: SIGSEGV - Segmentation fault (11)
Signal Address: (nil)
Signal Code: 0x00000001
Stack:
IP Function
---------------- --------------------------------------
000055615e53f822
000055615e53f240
000055615e55a872
000055615e4d24fb
00007fe75ba6a520 __sigaction+0x50
0000000000000000
000055615e4ee4ee
000055615e4ce7a4
000055615e4ce5c9
Process: 38589 - sqlservr
Thread: 38715 (application thread 0x1d0)
Instance Id: ecd3af55-b388-444f-aeae-7fa1f77b951b
Crash Id: 0a3e20d4-4fbb-4ee2-ad24-d5ead7235f1a
Build stamp: da729593fa9bc048da0037e5e85e1b296f1e5a8fbc8e1385d683b5b22fa891e1
Distribution: Linux Mint 21.1
Processors: 8
Total Memory: 8006934528 bytes
Timestamp: Sat Mar 25 01:30:57 2023
Capturing a dump of 38589
Successfully captured dump: /var/opt/mssql/log/core.sqlservr.3_25_2023_1_30_57.38589
Executing: /opt/mssql/bin/handle-crash.sh with parameters
handle-crash.sh
/opt/mssql/bin/sqlservr
38589
/opt/mssql/bin
/var/opt/mssql/log/
ecd3af55-b388-444f-aeae-7fa1f77b951b
0a3e20d4-4fbb-4ee2-ad24-d5ead7235f1a
/var/opt/mssql/log/core.sqlservr.3_25_2023_1_30_57.38589
Linux Mint 21.1
Capturing core dump and information to /var/opt/mssql/log...
Hint: You are currently not seeing messages from other users and the system.
Users in groups 'adm', 'systemd-journal' can see all messages.
Pass -q to turn off this notice.
No journal files were opened due to insufficient permissions.
Hint: You are currently not seeing messages from other users and the system.
Users in groups 'adm', 'systemd-journal' can see all messages.
Pass -q to turn off this notice.
No journal files were opened due to insufficient permissions.
/usr/bin/tail: cannot open '/var/log/syslog' for reading: Permission denied
Sat Mar 25 01:31:00 AM CET 2023 Capturing program information
Dump already generated: /var/opt/mssql/log/core.sqlservr.3_25_2023_1_30_57.38589, moving to /var/opt/mssql/log/core.sqlservr.38589.temp/core.sqlservr.38589.gdmp
Moving logs to /var/opt/mssql/log/core.sqlservr.38589.temp/log/paldumper-debug.log
Sat Mar 25 01:31:00 AM CET 2023 Capturing program binaries
/usr/bin/find: ‘/usr/local/openssl-3.0.7/test-runs/test_rehash/rehash.231763’: Permission denied
Sat Mar 25 01:31:02 AM CET 2023 Compressing the dump files
Core dump and information are being compressed in the background. When
complete, they can be found in the following location:
/var/opt/mssql/log/core.sqlservr.03_25_2023_01_30_59.38589.tbz2
Initial setup of Microsoft SQL Server failed. Please consult the ERRORLOG
in /var/opt/mssql/log for more information.
I tried deleting mssql-server fully and then reinstalling it but it just doesn't work. I tried to manually install it, yet still not working and it is the same output always.
rtoxis
(1 rep)
Mar 26, 2023, 12:36 AM
• Last activity: Mar 26, 2023, 12:39 AM
3
votes
1
answers
1120
views
Installing MS SQL Server on Debian 11 -- Repo Signature Problem
trying install MS SQL Server 2022 on Debian 11 is driving me crazy, as I'm not being able to add MS repo properly. First of all, step-by-step guide by Microsoft -just for Ubuntu- in this page: https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-linux-ver16&p...
trying install MS SQL Server 2022 on Debian 11 is driving me crazy, as I'm not being able to add MS repo properly.
First of all, step-by-step guide by Microsoft -just for Ubuntu- in this page: https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-linux-ver16&preserve-view=true
I add the the repo and import the public key, but doing sudo apt-get update gives the following error:
Error: https://packages.microsoft.com/ubuntu/20.04/mssql-server-2022 focal InRelease: the following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
I try importing again, but this time using gpg, importing the public key:
--recv-keys --keyserver https://packages.microsoft.com/keys/microsoft.asc EB3E94ADBE1229CF
The key was added, I even check it with Kleopatra an the public key is imported.
But then again, doing sudo apt-get update, I get the same error again!
Error: https://packages.microsoft.com/ubuntu/20.04/mssql-server-2022 focal InRelease: the following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
I don't understand why apt-get cannot find the public key, if it is correctly imported.
Thanks in advance!
NetRunner77
(31 rep)
Dec 20, 2022, 01:29 AM
• Last activity: Dec 20, 2022, 02:47 AM
0
votes
1
answers
991
views
Cannot install Microsoft SQL Server to Ubuntu AWS /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.30' not found
I am trying to install SQL server onto a Ubuntu machine on AWS and it has been nothing but trouble. I get stuck on the last step, configuring the server after selecting edition and setting an administrator password. I get this message /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.30' not found....
I am trying to install SQL server onto a Ubuntu machine on AWS and it has been nothing but trouble. I get stuck on the last step, configuring the server after selecting edition and setting an administrator password. I get this message /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.30' not found.
This is for a class, so the version of Ubuntu and the SQL server are fixed and cannot be changed. I have tried half a dozen different instances on AWS but get the same error regardless.

Aguso1133
(1 rep)
Sep 24, 2022, 06:24 AM
• Last activity: Sep 24, 2022, 07:10 AM
1
votes
0
answers
916
views
Ubuntu - Microsoft SQLCMD - Error Locating Server/Instance Specified
So, I have this issue that I can't connect to an MS SQL Server from an Ubuntu VM. The situation: - One Windows Server with multiple MS SQL Instances - Two Ubuntu 20.04 LTS VMs One of the two Ubuntu VMs was perfectly able to connect to the SQL server using ``` sqlcmd -S sqserver.example.com\\instance...
So, I have this issue that I can't connect to an MS SQL Server from an Ubuntu VM.
The situation:
- One Windows Server with multiple MS SQL Instances
- Two Ubuntu 20.04 LTS VMs
One of the two Ubuntu VMs was perfectly able to connect to the SQL server using
sqlcmd -S sqserver.example.com\\instance1 -U sql.serviceaccount -P 'mypassword'
`
but on the other server (which is very similar in setup, same network, ubuntu version etc) I get the following error
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : MAX_PROVS: Error Locating Server/Instance Specified [xFFFFFFFF]. .
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
So, I began to trouble shoot on VM2:
- I can ping sqserver.example.com
- Using nc
I can connect to the open port of the SQL instance (something like port 56042)
- Removed every firewall rule and allowed all traffic using iptables`
- Rebooted the VM
- Checked the IP config (which is like the VM1 where it does work, only the IP address is one higher, 172.16.1.12 instead of 172.16.1.11).
- Checked the ARP tables on both ends, making sure there was nothing funky there (no duplicate IPs or something)
On the SQL side:
- Double checked that the SQL Browser Service was running (and restarted it)
- Restarted the SQL instance`
- Checked if there was a Windows Firewall (there isn't one enabled).
Having done all that I gave up and reinstalled Ubuntu on VM2. Default server install, nothing special. Installed the Microsoft SQL tools on the same manner as before (and as on the VM01).
Of course I sort of hoped it would work but to my suprise and chagerin I get the following:
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : MAX_PROVS: Error Locating Server/Instance Specified [xFFFFFFFF]. .
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
r
Exactly the same error.
Besides that I can ping the SQL server I can also download files from a webserver on that machine using curl
to the VM02.
I am a bit out of options. The SQL server is reachable by another Linux machine and several Windows machines.
----------
Update:
Using this piece of Python script I discovered I just don't get a answer from the SQL browsers service.
On VM1 I get the following response:
Instance 172.16.1.123\instance1 is listening on port 56044.
On VM2 I get the following response:
No response from the SQL Browser service. Verify that the service is available on 172.16.1.123 and \instance1 is a valid instance name on it.
Of course, both running with the same script.
----------
Update:
So I can connect to a specific instance using
sqlcmd -S tcp:sqlserver.example.com,56040 -U sqlaccount
So this work, still very strange but I'll take it for the moment.
RS Finance
(111 rep)
Jul 25, 2022, 05:21 PM
• Last activity: Jul 26, 2022, 10:07 AM
0
votes
0
answers
375
views
Help to configure SSH tunnel to access to a remote server
Here my scenario: 192.168.2.222 --- VPN ---> 192.168.2.200 / 192.168.0.10 --- LAN ---> 192.168.0.50 My local machine My remote machine Target server Due to the netmask of the VPN interface (`/24`) from my local machine I cannot reach the target server directly. But if I SSH into my remote machine, t...
Here my scenario:
192.168.2.222 --- VPN ---> 192.168.2.200 / 192.168.0.10 --- LAN ---> 192.168.0.50
My local machine My remote machine Target server
Due to the netmask of the VPN interface (
/24
) from my local machine I cannot reach the target server directly.
But if I SSH into my remote machine, then I can reach it because the remote (local) interface is on the same subnet of the target server.
In order to use some tools on my local machine I want to enable SSH tunnel on my remote machine.
For example, let's say I want to access a SQLServer server (port 3306) on the target server.
I set up DBeaver
to use SSH tunnel on my remote machine but it cannot connect to the database.
On my remote machine the sshd.config
file is the following:
Include /etc/ssh/sshd_config.d/*.conf
ChallengeResponseAuthentication no
UsePAM yes
GatewayPorts yes
X11Forwarding yes
PrintMotd no
PermitTunnel yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
To manually test it out I did:
$local ssh -L 13306:192.168.0.50:3306 user@192.168.2.200
$local sqsh -S 192.168.0.50:13306 -U user -D database -P password
I got:
sqsh-2.5.16.1 Copyright (C) 1995-2001 Scott C. Gray
Portions Copyright (C) 2004-2014 Michael Peppler and Martin Wesdorp
This is free software with ABSOLUTELY NO WARRANTY
For more information type '\warranty'
Open Client Message
Layer 0, Origin 0, Severity 78, Number 41
Unable to connect: Adaptive Server is unavailable or does not exist
Open Client Message
Layer 0, Origin 0, Severity 78, Number 41
Unable to connect: Adaptive Server is unavailable or does not exist
Issuing the very same command on my remote machine (of course using 3306 instead of 13306) leads to a successfully connection.
I also checked the port 13306 from my local machine but it's still closed:
$local nmap 192.168.2.200 -p 13306
Starting Nmap 7.80 ( https://nmap.org ) at 2022-04-15 13:10 CEST
Nmap scan report for 192.168.2.200
Host is up (0.014s latency).
PORT STATE SERVICE
13306/tcp closed unknown
What should I set up further?
Mark
(815 rep)
Apr 15, 2022, 11:11 AM
• Last activity: Apr 15, 2022, 11:54 AM
1
votes
1
answers
131
views
ODBC connection from a Linux box to MS SQLServer
I need to connect to MS SQLServer from a Linux box using ODBC from a Qt application I am developing. So far I have installed the ODBC MS SQLServer driver and Kerberos on the Linux box. Using kinit I am able to get a ticket for my windows user (mvincent@mydomain.local). I am logged into the Linux box...
I need to connect to MS SQLServer from a Linux box using ODBC from a Qt application I am developing.
So far I have installed the ODBC MS SQLServer driver and Kerberos on the Linux box. Using kinit I am able to get a ticket for my windows user (mvincent@mydomain.local).
I am logged into the Linux box as a local user (mvincent@linuxbox).
I am unsure how to get a ticket from windows active directory for my linux box login as mvincent@linuxbox is not in Active Directory.
I am using
Trusted_Connection=yes
in my ODBC connection string. The MS SQLServer instance is configured to only use Windows authentication so I can't use Uid=xxx
and Pwd=ssss
in the connection string.
How can I connect to MS SQLServer in the above scenario?
Michael Vincent
(111 rep)
Sep 29, 2015, 10:33 AM
• Last activity: Mar 9, 2022, 05:27 PM
2
votes
3
answers
2025
views
kdump in CentOS 7
I wanted to migrate to CentOS 7.5 from CentOS 6.9. during installation I saw an option `kdump` that i could enable or disable. I wonder what is `kdump` and disabling it has any bad effect on server? I want to install database on my server later I just want to make sure that `kdump` cause no problem.
I wanted to migrate to CentOS 7.5 from CentOS 6.9. during installation I saw an option
kdump
that i could enable or disable. I wonder what is kdump
and disabling it has any bad effect on server? I want to install database on my server later I just want to make sure that kdump
cause no problem.
BlackCrystal
(786 rep)
Dec 29, 2018, 06:37 AM
• Last activity: Jul 30, 2021, 03:54 PM
1
votes
1
answers
543
views
mssql-server on debian broken after update?
Time ago I installed mssql-server on my debian VPS and works fine. Now, mssql-server not run and I don't know what is changed. If type `/opt/mssql/bin/sqlserver` I get 2019-07-07 18:13:19.79 Logon Error: 18456, Severity: 14, State: 7. 2019-07-07 18:13:19.79 Logon Login failed for user 'sa'. Reason:...
Time ago I installed mssql-server on my debian VPS and works fine. Now, mssql-server not run and I don't know what is changed.
If type
/opt/mssql/bin/sqlserver
I get
2019-07-07 18:13:19.79 Logon Error: 18456, Severity: 14, State: 7.
2019-07-07 18:13:19.79 Logon Login failed for user 'sa'. Reason: An error occurred while evaluating the password. [CLIENT: 127.0.0.1]
If I start service sudo systemctl start mssql-server
I get
jul 07 18:27:23 vps495056 systemd: Started Microsoft SQL Server Database Engine.
-- Subject: Unit mssql-server.service has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit mssql-server.service has finished starting up.
--
-- The start-up result is done.
jul 07 18:27:23 vps495056 sqlservr: /opt/mssql/bin/sqlservr Error: Directory [/var/opt/system/] could not be created. Errno
jul 07 18:27:23 vps495056 systemd: mssql-server.service: Main process exited, code=exited, status=1/FAILURE
I created var/opt/system
directory because it not exist.
drwxr-sr-x 2 mssql mssql 4096 jul 5 18:46 system
The mssql config file
# cat /var/opt/mssql/mssql.conf
[EULA]
accepteula = Y
[language]
lcid = 1033
I tried reinstalled mssql-server but no luck. I get same errors after that.
crossmax
(199 rep)
Jul 7, 2019, 04:34 PM
• Last activity: Jan 6, 2021, 03:02 PM
1
votes
1
answers
3429
views
connect mssql database on Centos 8 using php 7.4
I cannot figure out the way to connect **MSSQL 2014** database on **centos 8** using **PhP 7.4**. I found [GitHub link][1] and downloaded [CentOS8-7.4.tar ][2] and extracted the **php_sqlsrv_72_ts.so** and **php_pdo_sqlsrv_72_ts.so**. but not sure where to paste the modules like > windows => xampp f...
I cannot figure out the way to connect **MSSQL 2014** database on **centos 8** using **PhP 7.4**.
I found GitHub link and downloaded CentOS8-7.4.tar
and extracted the **php_sqlsrv_72_ts.so** and **php_pdo_sqlsrv_72_ts.so**. but not sure where to paste the modules like
> windows => xampp folder > php >> extensions
> edit php.ini; extension=php_sqlsrv_72_ts and restart web server
Any help or guidance is really appreciated.
Here are the commands I did run:
dnf -y update
dnf install yum-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm -y
dnf module reset php
dnf module enable php:remi-7.4
yum module reset nginx
yum module enable nginx:1.16
dnf install wget nginx php-fpm mariadb-server php-mysqli php-gd php-imap php-xml php-mbstring php-intl php-pecl-apcu php-opcache php-pecl-zip
systemctl enable --now nginx php-fpm mariadb
firewall-cmd --permanent --zone=public --add-service=http --add-service=https
firewall-cmd --reload
PHP:
"dummydatabase", "UID"=>"sa", "PWD"=>"mystrongpasswrod",'ReturnDatesAsStrings'=> true);
$conn = sqlsrv_connect( $serverName, $connectionInfo );
if( $conn === false ) {
die( print_r( sqlsrv_errors(), true));
}
else{
echo 'Successfully Connected';
}
Ratan Thapa
(11 rep)
Dec 13, 2020, 06:22 PM
• Last activity: Dec 14, 2020, 03:41 PM
4
votes
5
answers
9128
views
sqlcmd does not work: Can't open lib libmsodbcsql.13.dylib
I've installed `mssql-tools` and `msodbcsql`, And I've symlinked `/usr/local/homebrew/lib/libmsodbcsql.13.dylib` to `/usr/local/lib/libmsodbcsql.13.dylib` But sqlcmd still complains about missing lib, %> sqlcmd -S IP Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Can't open lib '/usr/local...
I've installed
mssql-tools
and msodbcsql
,
And I've symlinked /usr/local/homebrew/lib/libmsodbcsql.13.dylib
to /usr/local/lib/libmsodbcsql.13.dylib
But sqlcmd still complains about missing lib,
%> sqlcmd -S IP
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Can't open lib '/usr/local/lib/libmsodbcsql.13.dylib' : file not found.
Any ideas?
daisy
(55777 rep)
Jun 9, 2017, 04:32 PM
• Last activity: Aug 7, 2020, 02:44 AM
0
votes
1
answers
418
views
SQL Server 2019 (Centos 8) Non-Yielding Scheduler
We are running SQL Server 2019 (Linux) CU4 with the following server specs: * OS: Centos 8 * RAM: 32GB * HDD: 1TB SSD * CPU: 8 Core I-7 * SQL: Microsoft SQL Server 2019 (RTM-CU4) (KB4548597) - 15.0.4033.1 (X64) Standard Edition (64-bit) on Linux (CentOS Linux 8 (Core)) The SQL server becomes unrespo...
We are running SQL Server 2019 (Linux) CU4 with the following server specs:
* OS: Centos 8
* RAM: 32GB
* HDD: 1TB SSD
* CPU: 8 Core I-7
* SQL: Microsoft SQL Server 2019 (RTM-CU4) (KB4548597) - 15.0.4033.1 (X64) Standard Edition (64-bit) on Linux (CentOS Linux 8 (Core))
The SQL server becomes unresponsive after heavy loads (it appears) and has the following in the SQLDump file after a crash...
2020-04-09 02:38:11.48 spid12s AppDomain 3 (mssqlsystemresource.dbo[runtime].2) is marked for unload due to memory pressure.
2020-04-09 02:38:11.48 spid12s AppDomain 3 (mssqlsystemresource.dbo[runtime].2) unloaded.
2020-04-09 10:09:43.60 spid31s AppDomain 2 (master.sys[runtime].1) is marked for unload due to memory pressure.
2020-04-09 10:09:43.61 spid31s AppDomain 2 (master.sys[runtime].1) unloaded.
2020-04-10 11:52:15.26 Backup Database backed up. Database: readyalert, creation date(time): 2020/02/11(08:19:22), pages dumped: 190987, first LSN: 67110:336:1, last LSN: 67110:360:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'/var/opt/mssql/backup/readyalert_prod.BAK'}). This is an informational message only. No user action is required.
2020-04-10 11:52:15.28 Backup BACKUP DATABASE successfully processed 190746 pages in 4.842 seconds (307.765 MB/sec).
2020-04-12 00:00:02.54 spid59 . Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.
2020-04-12 00:00:12.34 spid59 DBCC CHECKDB (readyalert) executed by NT AUTHORITY\NETWORK SERVICE found 0 errors and repaired 0 errors. Elapsed time: 0 hours 0 minutes 9 seconds. Internal database snapshot has split point LSN = 00010627:00010e78:0001 and first LSN = 00010627:00010e68:0001.
2020-04-15 11:12:58.53 spid59 AppDomain 4 (mssqlsystemresource.dbo[runtime].3) created.
2020-04-15 11:16:28.21 spid88 AppDomain 5 (master.sys[runtime].4) created.
2020-04-15 14:39:02.71 Server Using 'dbghelp.dll' version '4.0.5'
2020-04-15 14:39:02.76 Server ***Unable to get thread context for spid 0
2020-04-15 14:39:02.76 Server * *******************************************************************************
2020-04-15 14:39:02.76 Server *
2020-04-15 14:39:02.76 Server * BEGIN STACK DUMP:
2020-04-15 14:39:02.76 Server * 04/15/20 14:39:02 spid 384
2020-04-15 14:39:02.76 Server *
2020-04-15 14:39:02.76 Server * Non-yielding Scheduler
2020-04-15 14:39:02.76 Server *
2020-04-15 14:39:02.76 Server * *******************************************************************************
2020-04-15 14:39:02.77 Server Stack Signature for the dump is 0x0000000000000338
Any help would be appreciated as we tried updating to the latest CU4 and the problem still persists.
Kevin Dobson
(11 rep)
Apr 22, 2020, 02:57 PM
• Last activity: Jul 17, 2020, 09:23 PM
0
votes
1
answers
87
views
Resetting Debian Password without restarting at all?
My company has a Debian server that holds and runs some important stuff that cannot be shut down... The previous Joe before me, didn't seem to have a password logged or even passed on the information about it, so we're at a loss. Is there a way to *recover/change/get into the computer files* without...
My company has a Debian server that holds and runs some important stuff that cannot be shut down... The previous Joe before me, didn't seem to have a password logged or even passed on the information about it, so we're at a loss.
Is there a way to *recover/change/get into the computer files* without resetting the server?
jon compton
(3 rep)
Jun 23, 2020, 07:13 PM
• Last activity: Jun 23, 2020, 08:59 PM
Showing page 1 of 20 total questions