➜ ~ sudo /opt/mssql/bin/mssql-conf setup Choose an edition of SQL Server: 1) Evaluation (free, no production use rights, 180-day limit) 2) Developer (free, no production use rights) 3) Express (free) 4) Web (PAID) 5) Standard (PAID) 6) Enterprise (PAID) 7) Enterprise Core (PAID) 8) I bought a license through a retail sales channel and have a product key to enter.
Details about editions can be found at https://go.microsoft.com/fwlink/?LinkId=852748&clcid=0x409
Use of PAID editions of this software requires separate licensing through a Microsoft Volume Licensing program. By choosing a PAID edition, you are verifying that you have the appropriate number of licenses in place to install and run this software.
Enter your edition(1-8): 3 The license terms for this product can be found in /usr/share/doc/mssql-server or downloaded from: https://go.microsoft.com/fwlink/?LinkId=855862&clcid=0x409
The privacy statement can be viewed at: https://go.microsoft.com/fwlink/?LinkId=853010&clcid=0x409
Enter the SQL Server system administrator password: The specified password does not meet SQL Server password policy requirements because it is not complex enough. The password must be at least 8 characters long and contain characters from three of the following four sets: uppercase letters, lowercase letters, numbers, and symbols. Enter the SQL Server system administrator password: Confirm the SQL Server system administrator password: Configuring SQL Server...
The licensing PID was successfully processed. The new edition is [Express Edition]. Created symlink from /etc/systemd/system/multi-user.target.wants/mssql-server.service to /lib/systemd/system/mssql-server.service. Setup has completed successfully. SQL Server is now starting.
➜ ~ sudo docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bff7378d26e4 microsoft/mssql-server-linux:2017-latest "/bin/sh -c /opt/mss…" 36 seconds ago Up 35 seconds 0.0.0.0:1401->1433/tcp sql1
最后我们就连接下数据库吧 sqlcmd -S 192.168.0.102,1401 -U SA -p 注意映射的主机端口不是默认的1433，是1401，所以要指定端口登录