<p>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?</p>

Onur AKKÖSE
<p>You can forward your sql server port to localhost and then connect to the database using SQL Server Management Studio.</p>
<pre><code>kubectl port-forward &lt;sql-pod-name&gt; &lt;localhost-port&gt;:&lt;mssql-port&gt;
</code></pre>
<p>For example:</p>
<pre><code>kubectl port-forward mssql-statefulset-0 1433:1433
</code></pre>
<p>Then your database would be accessed on localhost.</p>
<p><img src="https://i.stack.imgur.com/ERgeO.png" alt="enter image description here" /></p>
<p>Note that there is a comma between the address and the port.</p>
<p>If you manage to connect successfully, you can manually create the database using the SQL Server Management Studio tool.</p>
<p>Another way is to connect directly to your database container inside a pod using exec command and then execute sqlcmd commands.</p>
<pre><code>kubectl exec -it &lt;pod-name&gt; -- /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'SA-password'
</code></pre>
<p>Or just like this</p>
<pre><code>kubectl exec -it &lt;pod-name&gt; -- /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'SA-password' -Q 'CREATE DATABASE &lt;database-name&gt;'
</code></pre>
