RHEL7 VMにSQL Serverをインストールしました
msodbcsql-13.1.1.0-1.x86_64
mssql-server-14.0.100.187-1.x86_64
mssql-tools-14.0.2.0-1.x86_64
# ls -al /opt/
total 4
drwxr-xr-x. 5 root root 52 Jan 13 08:31 .
drwxr-xr-x. 17 root root 4096 Jan 13 07:55 ..
drwxr-xr-x. 3 root root 22 Jan 13 08:31 Microsoft
drwxr-xr-x. 4 root root 26 Jan 13 08:14 mssql
drwxr-xr-x. 4 root root 28 Jan 13 08:31 mssql-tools
systemctlはSQLサーバーが稼働中であることを示しています/緑
# systemctl status mssql-server
mssql-server.service - Microsoft(R) SQL Server(R) Database Engine
Loaded: loaded (/usr/lib/systemd/system/mssql-server.service; enabled)
Active: active (running) since Fri 2017-01-13 08:16:52 EST; 18min ago
Main PID: 8413 (sqlservr)
CGroup: /system.slice/mssql-server.service
├─8413 /opt/mssql/bin/sqlservr
└─8423 /opt/mssql/bin/sqlservr
Jan 13 08:16:55 example.novalocal sqlservr[8413]: 2017-01-13 13:16:55.33 spid17s SQL Server is now ready for client connections. This is an informational message; no user action is required.
Jan 13 08:16:55 example.novalocal sqlservr[8413]: 2017-01-13 13:16:55.54 spid6s Starting up database 'tempdb'.
Jan 13 08:16:55 example.novalocal sqlservr[8413]: 2017-01-13 13:16:55.65 spid6s The tempdb database has 1 data file(s).
Jan 13 08:16:55 example.novalocal sqlservr[8413]: 2017-01-13 13:16:55.65 spid20s The Service Broker endpoint is in disabled or stopped state.
Jan 13 08:16:55 example.novalocal sqlservr[8413]: 2017-01-13 13:16:55.66 spid20s The Database Mirroring endpoint is in disabled or stopped state.
Jan 13 08:16:55 example.novalocal sqlservr[8413]: 2017-01-13 13:16:55.67 spid20s Service Broker manager has started.
Jan 13 08:16:55 example.novalocal sqlservr[8413]: 2017-01-13 13:16:55.67 spid5s Recovery is complete. This is an informational message only. No user action is required.
Jan 13 08:21:58 example.novalocal sqlservr[8413]: 2017-01-13 13:21:58.06 spid51 Using 'dbghelp.dll' version '4.0.5'
Jan 13 08:22:02 example.novalocal sqlservr[8413]: 2017-01-13 13:22:02.41 spid51 Attempting to load library 'xplog70.dll' into memory. This is an informational message only. No user action is required.
Jan 13 08:22:02 example.novalocal sqlservr[8413]: 2017-01-13 13:22:02.44 spid51 Using 'xplog70.dll' version '2016.140.100' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.
ログインできません
# sqlcmd -S localhost -U SA
Password:
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : TCP Provider: Error code 0x2AF9.
Sqlcmd: Error: Microsoft ODBC Driver 13 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..
ファイアウォールルールなし
# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
接続は正常に機能しています
# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=51 time=9.80 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=51 time=9.94 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=51 time=9.63 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 9.633/9.793/9.941/0.126 ms
他の名前でも動作しません
# sqlcmd -S tcp:example,1433 -U SA
Password:
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : TCP Provider: Error code 0x2AF9.
Sqlcmd: Error: Microsoft ODBC Driver 13 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..
実行中のプロセス
# ps -ef | grep sql
mssql 8416 1 0 08:16 ? 00:00:00 /opt/mssql/bin/sqlservr-telemetry /var/opt/mssql/.system
mssql 8948 1 0 08:35 ? 00:00:00 /opt/mssql/bin/sqlservr
mssql 8950 8948 3 08:36 ? 00:00:06 /opt/mssql/bin/sqlservr
root 9103 1217 0 08:39 pts/0 00:00:00 grep --color=auto sql
ここにログ
# grep sqlservr messages
Jan 13 08:16:52 localhost sqlservr: This is an evaluation version. There are [151] days left in the evaluation period.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.39 Server Microsoft SQL Server vNext (CTP1.1) - 14.0.100.187 (X64)
Jan 13 08:16:54 localhost sqlservr: Dec 10 2016 02:51:11
Jan 13 08:16:54 localhost sqlservr: Copyright (C) 2016 Microsoft Corporation. All rights reserved.
Jan 13 08:16:54 localhost sqlservr: on Linux (Red Hat Enterprise Linux Server 7.0 (Maipo))
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.39 Server UTC adjustment: 0:00
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.39 Server (c) Microsoft Corporation.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.39 Server All rights reserved.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.39 Server Server process ID is 4116.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.39 Server Logging SQL Server messages in file 'C:\var\opt\mssql\log\errorlog'.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.40 Server Registry startup parameters:
Jan 13 08:16:54 localhost sqlservr: -d C:\var\opt\mssql\data\master.mdf
Jan 13 08:16:54 localhost sqlservr: -l C:\var\opt\mssql\data\mastlog.ldf
Jan 13 08:16:54 localhost sqlservr: -e C:\var\opt\mssql\log\errorlog
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.41 Server SQL Server detected 1 sockets with 4 cores per socket and 4 logical processors per socket, 4 total logical processors; using 4 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.41 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.41 Server Detected 6260 MB of RAM. This is an informational message; no user action is required.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.42 Server Using conventional memory in the memory manager.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.49 Server Default collation: SQL_Latin1_General_CP1_CI_AS (us_english 1033)
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.59 Server Buffer pool extension is already disabled. No action is necessary.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.69 Server InitializeExternalUserGroupSid failed. Implied authentication will be disabled.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.69 Server Implied authentication manager initialization failed. Implied authentication will be disabled.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.74 Server The maximum number of dedicated administrator connections for this instance is '1'
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.74 Server Node configuration: node 0: CPU mask: 0x000000000000000f:0 Active CPU mask: 0x000000000000000f:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.75 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.75 Server Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.76 Server Query Store settings initialized with enabled = 1,
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.77 spid5s Starting up database 'master'.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.78 Server In-Memory OLTP initialized on lowend machine.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.81 Server Software Usage Metrics is disabled.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.87 spid5s 8 transactions rolled forward in database 'master' (1:0). This is an informational message only. No user action is required.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.87 spid5s 0 transactions rolled back in database 'master' (1:0). This is an informational message only. No user action is required.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.88 spid5s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.92 spid5s Buffer pool extension is already disabled. No action is necessary.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.92 spid5s Resource governor reconfiguration succeeded.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.92 spid5s SQL Server Audit is starting the audits. This is an informational message. No user action is required.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.92 spid5s SQL Server Audit has started the audits. This is an informational message. No user action is required.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.96 spid5s SQL Trace ID 1 was started by login "sa".
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.96 spid5s Server name is 'xxx-sqlser'. This is an informational message only. No user action is required.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.97 spid17s Password policy update was successful.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.98 spid5s Starting up database 'msdb'.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.98 spid6s Starting up database 'mssqlsystemresource'.
Jan 13 08:16:54 localhost sqlservr: 2017-01-13 13:16:54.99 spid6s The resource database build version is 14.00.100. This is an informational message only. No user action is required.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.01 spid6s Starting up database 'model'.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.08 spid5s 7 transactions rolled forward in database 'msdb' (4:0). This is an informational message only. No user action is required.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.09 spid5s 0 transactions rolled back in database 'msdb' (4:0). This is an informational message only. No user action is required.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.09 spid5s Recovery is writing a checkpoint in database 'msdb' (4). This is an informational message only. No user action is required.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.11 spid6s 7 transactions rolled forward in database 'model' (3:0). This is an informational message only. No user action is required.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.11 spid6s 0 transactions rolled back in database 'model' (3:0). This is an informational message only. No user action is required.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.12 spid6s Recovery is writing a checkpoint in database 'model' (3). This is an informational message only. No user action is required.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.22 spid6s Polybase feature disabled.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.22 spid6s Clearing tempdb database.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.31 spid17s A self-generated certificate was successfully loaded for encryption.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.32 spid17s Server is listening on [ 0.0.0.0 <ipv4> 1433].
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.32 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.33 Server Dedicated admin connection support was established for listening locally on port 1434.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.33 spid17s SQL Server is now ready for client connections. This is an informational message; no user action is required.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.54 spid6s Starting up database 'tempdb'.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.65 spid6s The tempdb database has 1 data file(s).
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.65 spid20s The Service Broker endpoint is in disabled or stopped state.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.66 spid20s The Database Mirroring endpoint is in disabled or stopped state.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.67 spid20s Service Broker manager has started.
Jan 13 08:16:55 localhost sqlservr: 2017-01-13 13:16:55.67 spid5s Recovery is complete. This is an informational message only. No user action is required.
Jan 13 08:21:58 localhost sqlservr: 2017-01-13 13:21:58.06 spid51 Using 'dbghelp.dll' version '4.0.5'
Jan 13 08:22:02 localhost sqlservr: 2017-01-13 13:22:02.41 spid51 Attempting to load library 'xplog70.dll' into memory. This is an informational message only. No user action is required.
Jan 13 08:22:02 localhost sqlservr: 2017-01-13 13:22:02.44 spid51 Using 'xplog70.dll' version '2016.140.100' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.
Jan 13 08:35:59 localhost sqlservr: 2017-01-13 13:35:59.43 spid5s SQL Server is terminating in response to a 'stop' request from Service Control Manager. This is an informational message only. No user action is required.
Jan 13 08:36:00 localhost sqlservr: 2017-01-13 13:36:00.15 spid20s Service Broker manager has shut down.
Jan 13 08:36:00 localhost sqlservr: 2017-01-13 13:36:00.24 spid5s SQL Server shutdown has been initiated
Jan 13 08:36:00 localhost sqlservr: 2017-01-13 13:36:00.24 spid5s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
Jan 13 08:36:00 localhost sqlservr: This is an evaluation version. There are [151] days left in the evaluation period.
Jan 13 08:36:02 localhost sqlservr: 2017-01-13 13:36:02.78 Server Microsoft SQL Server vNext (CTP1.1) - 14.0.100.187 (X64)
Jan 13 08:36:02 localhost sqlservr: Dec 10 2016 02:51:11
Jan 13 08:36:02 localhost sqlservr: Copyright (C) 2016 Microsoft Corporation. All rights reserved.
Jan 13 08:36:02 localhost sqlservr: on Linux (Red Hat Enterprise Linux Server 7.0 (Maipo))
Jan 13 08:36:02 localhost sqlservr: 2017-01-13 13:36:02.78 Server UTC adjustment: 0:00
Jan 13 08:36:02 localhost sqlservr: 2017-01-13 13:36:02.79 Server (c) Microsoft Corporation.
Jan 13 08:36:02 localhost sqlservr: 2017-01-13 13:36:02.79 Server All rights reserved.
Jan 13 08:36:02 localhost sqlservr: 2017-01-13 13:36:02.79 Server Server process ID is 4116.
Jan 13 08:36:02 localhost sqlservr: 2017-01-13 13:36:02.79 Server Logging SQL Server messages in file 'C:\var\opt\mssql\log\errorlog'.
Jan 13 08:36:02 localhost sqlservr: 2017-01-13 13:36:02.79 Server Registry startup parameters:
Jan 13 08:36:02 localhost sqlservr: -d C:\var\opt\mssql\data\master.mdf
Jan 13 08:36:02 localhost sqlservr: -l C:\var\opt\mssql\data\mastlog.ldf
Jan 13 08:36:02 localhost sqlservr: -e C:\var\opt\mssql\log\errorlog
Jan 13 08:36:02 localhost sqlservr: 2017-01-13 13:36:02.81 Server SQL Server detected 1 sockets with 4 cores per socket and 4 logical processors per socket, 4 total logical processors; using 4 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
Jan 13 08:36:02 localhost sqlservr: 2017-01-13 13:36:02.81 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
Jan 13 08:36:02 localhost sqlservr: 2017-01-13 13:36:02.81 Server Detected 6260 MB of RAM. This is an informational message; no user action is required.
Jan 13 08:36:02 localhost sqlservr: 2017-01-13 13:36:02.81 Server Using conventional memory in the memory manager.
Jan 13 08:36:02 localhost sqlservr: 2017-01-13 13:36:02.89 Server Default collation: SQL_Latin1_General_CP1_CI_AS (us_english 1033)
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:02.99 Server Buffer pool extension is already disabled. No action is necessary.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.09 Server InitializeExternalUserGroupSid failed. Implied authentication will be disabled.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.09 Server Implied authentication manager initialization failed. Implied authentication will be disabled.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.14 Server The maximum number of dedicated administrator connections for this instance is '1'
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.14 Server Node configuration: node 0: CPU mask: 0x000000000000000f:0 Active CPU mask: 0x000000000000000f:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.15 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.15 Server Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.16 Server Query Store settings initialized with enabled = 1,
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.17 spid5s Starting up database 'master'.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.17 Server In-Memory OLTP initialized on lowend machine.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.21 Server Software Usage Metrics is disabled.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.41 spid5s Buffer pool extension is already disabled. No action is necessary.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.41 spid5s Resource governor reconfiguration succeeded.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.41 spid5s SQL Server Audit is starting the audits. This is an informational message. No user action is required.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.42 spid5s SQL Server Audit has started the audits. This is an informational message. No user action is required.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.47 spid5s SQL Trace ID 1 was started by login "sa".
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.50 spid5s Server name is 'xxx-sqlser'. This is an informational message only. No user action is required.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.51 spid5s Starting up database 'msdb'.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.51 spid6s Starting up database 'mssqlsystemresource'.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.52 spid6s The resource database build version is 14.00.100. This is an informational message only. No user action is required.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.54 spid6s Starting up database 'model'.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.69 spid17s A self-generated certificate was successfully loaded for encryption.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.69 spid6s Polybase feature disabled.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.69 spid6s Clearing tempdb database.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.70 spid17s Server is listening on [ 0.0.0.0 <ipv4> 1433].
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.70 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.70 Server Dedicated admin connection support was established for listening locally on port 1434.
Jan 13 08:36:03 localhost sqlservr: 2017-01-13 13:36:03.70 spid17s SQL Server is now ready for client connections. This is an informational message; no user action is required.
Jan 13 08:36:04 localhost sqlservr: 2017-01-13 13:36:04.01 spid6s Starting up database 'tempdb'.
Jan 13 08:36:04 localhost sqlservr: 2017-01-13 13:36:04.25 spid6s The tempdb database has 1 data file(s).
Jan 13 08:36:04 localhost sqlservr: 2017-01-13 13:36:04.25 spid20s The Service Broker endpoint is in disabled or stopped state.
Jan 13 08:36:04 localhost sqlservr: 2017-01-13 13:36:04.25 spid20s The Database Mirroring endpoint is in disabled or stopped state.
Jan 13 08:36:04 localhost sqlservr: 2017-01-13 13:36:04.26 spid20s Service Broker manager has started.
Jan 13 08:36:04 localhost sqlservr: 2017-01-13 13:36:04.28 spid5s Recovery is complete. This is an informational message only. No user action is required.
最初のコメントの後で編集
# sqlcmd -S xxx-sqlser -U sa
Password:
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : TCP Provider: Error code 0x2AF9.
Sqlcmd: Error: Microsoft ODBC Driver 13 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..
# netstat -tupan | grep 1433
tcp 0 0 0.0.0.0:1433 0.0.0.0:* LISTEN 8950/sqlservr
tcp 0 0 127.0.0.1:43245 127.0.0.1:1433 ESTABLISHED 8950/sqlservr
tcp 0 0 127.0.0.1:1433 127.0.0.1:43245 ESTABLISHED 8950/sqlservr
新しいエラー
# sqlcmd -S tcp:127.0.0.1,1434
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : SSPI Provider: No Kerberos credentials available.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Cannot generate SSPI context.
単純なSQLステートメントを実行できません。ここでログインが機能するのはなぜですか?
# sqlcmd -S tcp:127.0.0.1,1434 -U SA
Password:
1> Select @@version;
2> SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'),
3> SERVERPROPERTY ('edition');
4>
-A
オプションが存在しません。 Firewall-CMDが私のVM(最小インストール))にインストールされておらず、トラブルシューティングガイドに従いました。
# sqlcmd -A -S tcp:127.0.0.1,1434 -U SA
Sqlcmd: 'A': Unknown Option. Enter '-?' for help.
# sqlcmd -?
Microsoft (R) SQL Server Command Line Tool
Version 13.0.0001.0 Linux
Copyright (c) 2012 Microsoft. All rights reserved.
usage: sqlcmd [-U login id] [-P password]
[-S server or Dsn if -D is provided]
[-H hostname] [-E trusted connection]
[-N Encrypt Connection][-C Trust Server Certificate]
[-d use database name] [-l login timeout] [-t query timeout]
[-h headers] [-s colseparator] [-w screen width]
[-a packetsize] [-e echo input] [-I Enable Quoted Identifiers]
[-c cmdend]
[-q "cmdline query"] [-Q "cmdline query" and exit]
[-m errorlevel] [-V severitylevel] [-W remove trailing spaces]
[-u unicode output] [-r[0|1] msgs to stderr]
[-i inputfile] [-o outputfile]
[-k[1|2] remove[replace] control characters]
[-y variable length type display width]
[-Y fixed length type display width]
[-p[1] print statistics[colon format]]
[-R use client regional setting]
[-K application intent]
[-M multisubnet failover]
[-b On error batch abort]
[-D Dsn flag, indicate -S is Dsn]
[-X[1] disable commands, startup script, environment variables [and exit]]
[-x disable variable substitution]
[-? show syntax summary]
ここ エラーログ。コアダンプとSQLダンプはありません。
# sqlcmd -S tcp:127.0.0.1,1434 -U SA
Password:
1> PRINT "Length: 5"" 7'";
2> GO
Length: 5" 7'
1> Select @@version;
2> GO
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Microsoft SQL Server vNext (CTP1.1) - 14.0.100.187 (X64)
Dec 10 2016 02:51:11
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
on Linux (Red Hat Enterprise Linux Server 7.0 (Maipo))
(1 rows affected)
これはPORTの問題だと思います、
Firewall ExceptionでSQL用に構成されたポート(1433/1434)を追加してください。
以下のコマンドを使用して構成を開きます
Sudo system-config-firewall-tui
上記は、RHEL6以降の「ターミナルユーザーインターフェイス(TUI)ファイアウォールクライアント」を開きます
OR
Iptablesコマンドを使用して、ファイアウォールで新しいTCP/UDPポートを開きます。更新されたルールを永続的に保存するには、2番目のコマンドが必要です。
$ Sudo iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
$ Sudo service iptables save
それでうまくいくはずです