gpt4 book ai didi

sql-server - 如何将 .bacpac 导入 docker Sqlserver?

转载 作者:IT老高 更新时间:2023-10-28 12:46:37 33 4
gpt4 key购买 nike

我按照 this article 中的说明在我的 Mac 上的 docker 容器中安装了 Sqlserver .

我使用 Kitematic 运行容器并设法使用 Navicat Essentials for SQl Server 连接到服务器。服务器有四个数据库,我可以创建新数据库,但理想情况下,我想将现有数据库导入为 .bacpac。

说明from this answer过去对我有用。我可以在容器中运行类似的东西吗?或者,更一般地说,有没有办法在容器中导入数据库?

最佳答案

Hi all! We finally have a preview ready for sqlpackage that is built on dotnet core and is cross-platform! Below are the links to download from. They are evergreen links, i.e. each day a new build is uploaded. This way any checked in bug fix is available the next day. Included in the .zip file is the preview EULA.linuxhttps://go.microsoft.com/fwlink/?linkid=873926osxhttps://go.microsoft.com/fwlink/?linkid=873927windowshttps://go.microsoft.com/fwlink/?linkid=873928Release notes:

The /p:CommandTimeout parameter is hardcoded to 120Build and deployment contributors are not supporteda. Need to move to .NET Core 2.1 where System.ComponentModel.Composition.dll is supportedb. Need to handle case-sensitive pathsSQL CLR UDT types are not supported.a. This includes SQL Server Types SqlGeography, SqlGeometry, & SqlHierarchyIdOlder .dacpac and .bacpac files that use Json serialization are not supportedReferenced .dacpacs (e.g. master.dacpac) may not resolve due to issues with case-sensitive file systems

For lack of a better method, please provide any feedback you have here on this GitHub issue.

感谢您试一试并告诉我们进展如何!

https://github.com/Microsoft/mssql-docker/issues/135#issuecomment-389245587

编辑:我已经为你制作了一个 Docker 镜像

https://hub.docker.com/r/samuelmarks/mssql-server-fts-sqlpackage-linux/

设置容器、创建数据库、复制 .bacpac 文件并将其导入上述数据库的示例:

docker run -d -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' -p 1433:1433 --name sqlfts0 samuelmarks/mssql-server-fts-sqlpackage-linux
docker exec -it sqlfts0 /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '<YourStrong!Passw0rd>' -Q 'CREATE DATABASE MyDb0'
docker cp ~/Downloads/foo.bacpac sqlfts0:/opt/downloads/foo.bacpac
docker exec -it sqlfts0 dotnet /opt/sqlpackage/sqlpackage.dll /tsn:localhost /tu:SA /tp:'<YourStrong!Passw0rd>' /A:Import /tdn:MyDb0 /sf:foo.bacpac

关于sql-server - 如何将 .bacpac 导入 docker Sqlserver?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40685375/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com