In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Docker installation sql2017 restore windows2012 database backup 1. Centos7.6 installation docker# installation dependency package yum install-y yum-utils device-mapper-persistent-data lvm2# download dockeryum source yum-config-manager-- add-repo https://download.docker.com/linux/centos/docker-ce.repo# download dockeryum install-y docker# configuration domestic mirror [root@node1] # cat / etc/docker/daemon.json {"registry-mirrors": ["https://kfwkfulq.mirror.aliyuncs.com"," "https://2lqq34jg.mirror.aliyuncs.com","https://pee6w651.mirror.aliyuncs.com","https://registry.docker-cn.com","http://hub-mirror.c.163.com"],"dns": [" 8.8.8.8 " "8.8.4.4"]} # boot & boot dockersystemctl start docker & & systemctl enable docker2.docker installation mssql2017# search image [root@node1 ~] # docker search mssqlINDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATEDdocker.io docker.io/microsoft/mssql-server-linux Deprecated SQL Server on Linux Container R... 1159 docker.io docker.io/microsoft/mssql-server-windows-developer Official Microsoft SQL.. # download image [root@node1 ~] # docker pull microsoft/mssql-server-linux:2017-latest# view the downloaded image [root@node1 ~] # docker images REPOSITORY TAG IMAGE ID CREATED SIZEdocker.io/microsoft/mssql-server-linux 2017-latest 314918ddaedf 11 months ago 1.35 GB# create and run container [root@node1 ~] # docker run-- name MSSQL_1433-m 512m-e 'ACCEPT_EULA=Y'-e' SA_PASSWORD=yourpasSw0rd'-- net=host-d microsoft/mssql-server-linux [root@node1 ~] # docker Start eae198ad6034 (can launch ID or container name) eae198ad6034# to view the created container (UP represents already started) [root@node1 ~] # docker ps-aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESeae198ad6034 314918ddaedf "/ opt/mssql/bin/sq..." 24 hours ago Up 58 minutes MSSQL_14338b1962a03efe 314918ddaedf "/ bin/bash" 25 hours ago Exited (0) 24 hours ago linuxmssql# enter the container [root@node1] # docker exec-it eae198ad6034 / bin/bash# enter the database (IP is the IP of the host The user is in uppercase) root@node1:~# / opt/mssql-tools/bin/sqlcmd-S 172.16.10.66-U SA-P 'lihao@123' # this indicates that you have entered the database 1 > select name from sys.databases 2 > goname -master Tempdb model Msdb 3. Restore database # upload backup files download winscp or lrzsz tools, upload backup files to host computer Then copy the backup files to the container's / var/opt/mssql/data/ directory [root@node1 ~] # docker cp EastRiver.bak eae198ad6034:/var/opt/mssql/data/root@node1:~# ll / var/opt/mssql/data/total 1300488drwxr-xr-x 2 root root 4096 Nov 19 14:25. / drwxr-xr-x 7 root root 73 Nov 18 15:23.. /-rw-r--r-- 1 root root 205852672 Nov 15:23: 43 EastRiver.bak-rw-r- 1 root root 4194304 Nov 19 15:14 master.mdf-rw-r- 1 root root 2097152 Nov 19 15:23 mastlog.ldf-rw-r- 1 root root 8388608 Nov 19 14:09 model.mdf-rw-r- 1 root root 8388608 Nov 19 14:09 modellog.ldf-rw-r- 1 root root 15466496 Nov 19 15:14 msdbdata.mdf-rw-r -1 root root 786432 Nov 19 15:14 msdblog.ldf-rw-r- 1 root root 8388608 Nov 19 14:09 tempdb.mdf-rw-r- 1 root root 8388608 Nov 19 15:14 templog.ldf-rw-r- 1 root root 8388608 Nov 19 14:09 test.mdf-rw-r- 1 root root 8388608 Nov 19 15:09 test_log.ldf # Open the sql management tool under Windows (I can't use 2008R2 Chinese version It is possible to use the English version of 2012. It is not clear whether it is the relationship between Chinese and English or the version. If you are interested, you can try) create a new test library create database test.
# restore the database
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.