如何在Ubuntu上安装MSSQL-Server 22.04

发布于 2025-02-02 21:15:03 字数 131 浏览 3 评论 0 原文

我正在尝试在Ubuntu 22.04上安装MSSQL-Server。我知道它目前不支持Ubuntu 22.04。我需要找到解决方法来安装软件,因为我不想降级。

我尝试安装,但它一直给我带来依赖性错误。我该如何解决?任何帮助将不胜感激。

I am trying to install MSSQL-Server on my Ubuntu 22.04. I know that it does not currently support Ubuntu 22.04. I need to find a workaround to install the software as I don't want to downgrade.

I tried installing but it keeps giving me dependency errors. How do I solve it? Any help would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

合久必婚 2025-02-09 21:15:03

不幸的是,目前,SQL Server 2019仅在Ubuntu 20/21上使用。目前不支持22.04。

因此,要么您必须使用Ubuntu 20,要么正如其他人所述,要么使用Docker容器。

您可以将Docker安装到Ubuntu 22.04中。这是一个多步骤的过程,但这并不困难。

  1. 在Ubuntu上安装Docker Engine(遵循使用存储库部分安装)
    https://docss.docks.docker.com/engine/engine/ingine/install/ ubuntu/#设置 - repository
  2. 安装SQL Server容器
    https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-ver15&pivots = cs1-bash

这应该做到。

另外,在链接#2中,在下面的链接#2中,有关如何连接到docker映像以从容器内部运行SQLCMD。

像SQL Server 2019一样,您无法将SQLCMD工具直接安装到Ubuntu 22.04安装中。但是Docker容器图像包含SQLCMD工具,以便您能够连接到数据库。

或者,您可以使用SQL Server(MSSQL)扩展名使用Visual Studio代码,并且可以在运行Docker容器中连接到您的SQL Server实例。

连接字符串将是:

“ server = localhost; database = 您的数据库名称;用户ID = 用户ID ; password = password

您可以如果您只想连接到默认数据库,则忽略数据库设置。

如果创建任何数据库,则可以通过指定名称直接连接到它们。

Unfortunately, at this time, SQL Server 2019 only works on Ubuntu 20/21. 22.04 is not supported at this time.

So either you will have to use Ubuntu 20 or, as others have stated, use Docker Containers.

You can install Docker into Ubuntu 22.04. It's a multi-step process, but it isn't that difficult.

  1. Install Docker Engine on Ubuntu (follow the Install using the repository section)
    https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository
  2. Install SQL Server Container
    https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-ver15&pivots=cs1-bash

That should do it.

Also, in link #2, read further below on how to connect to your docker image to run SQLCMD from within the container.

Like SQL Server 2019, you cannot install the SQLCMD tools directly into your Ubuntu 22.04 installation. But the Docker container image contains the sqlcmd tool for you to be able to connect to the database.

Or, you can use Visual Studio Code with the SQL Server (mssql) extension and it can connect to your SQL Server instance in your running Docker container.

The connection string would be:

"Server=localhost;Database=your database name;User Id=user id;Password=password"

You can leave out the Database setting if you just want to connect to the default database.

If you create any databases, you can then connect to them directly by specifying the name.

莫言歌 2025-02-09 21:15:03

我也有这样的问题。我还尝试将OpenSSL降至 1.1.1k 1.1.1s ,但仍然行不通。最后,我发现了这种解释

因此,请继续使用OpenSSL 3.0.2,您只需要将 seclevel 更改为 0 而不是 1 1 < /code>在 /etc/ssl/openssl.conf

[system_default_sect]
CipherString = DEFAULT:@SECLEVEL=0

,现在可以使用Ubuntu 22.04连接到SQL Server。

I also have same problem like this. I also tried downgrading Openssl to 1.1.1k and 1.1.1s but still not works. And finally I found this explanation

https://github.com/microsoft/msphpsql/issues/1419#issuecomment-1303626500

So, keep use OpenSSL 3.0.2 and you just need to change the SECLEVEL to 0 instead of 1 in /etc/ssl/openssl.conf

[system_default_sect]
CipherString = DEFAULT:@SECLEVEL=0

And it works, now I can connect to SQL Server using Ubuntu 22.04.

巷子口的你 2025-02-09 21:15:03

这个
它对我有用!

请尝试一下

cd /opt/mssql/lib
ls -la
sudo rm libcrypto.so libssl.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 libcrypto.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.1 libssl.1.1

如果没有安装LiBSSL,

sudo apt install libssl1.1

,尝试:更新:我使用Libssl1.1连接了问题,因此执行了前一步后,我切换到1.0,所以我也做了以下操作:

sudo systemctl stop mssql-server
sudo systemctl edit mssql-server 

添加:

[Service]
Environment="LD_LIBRARY_PATH=/opt/mssql/lib"

然后:然后:

sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /opt/mssql/lib/libssl.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /opt/mssql/lib/libcrypto.so

然后:启动MySQL - 服务器和事情效果很好!

Looked at this
and it has worked for me!

So worth giving it a shot

cd /opt/mssql/lib
ls -la
sudo rm libcrypto.so libssl.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 libcrypto.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.1 libssl.1.1

If libssl is not installed, try:

sudo apt install libssl1.1

Update: I had issues connecting using libssl1.1, so I switched to 1.0 after performing the previous steps, so I also did the following:

sudo systemctl stop mssql-server
sudo systemctl edit mssql-server 

Added:

[Service]
Environment="LD_LIBRARY_PATH=/opt/mssql/lib"

Then:

sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /opt/mssql/lib/libssl.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /opt/mssql/lib/libcrypto.so

Then started mysql-server and things just worked fine!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文