Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I want to create sample database fpr Sql server on Kubernetes

I deployed sql server 2017 to my kubernetes and I want to put it a sample db such as northwind. There is no a gui for manage sql server. How Can I do that

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You can forward your sql server port to localhost and then connect to the database using SQL Server Management Studio.

kubectl port-forward <sql-pod-name> <localhost-port>:<mssql-port>

For example:

kubectl port-forward mssql-statefulset-0 1433:1433

Then your database would be accessed on localhost.

enter image description here

Note that there is a comma between the address and the port

Another way is to connect directly to your database container inside a pod using exec command

kubectl exec -it <pod-name> -- /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'SA-password'
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading