mssql-docker icon indicating copy to clipboard operation
mssql-docker copied to clipboard

sqlservr: This program requires a machine with at least 3250 megabytes of memory

Open JonathanImperato opened this issue 9 years ago • 13 comments

I am getting this error. I am creating a ms-sql-linux-server by using docker toolbox. How can i fix this error?

Is there a way since i have not a console to switch it? I have not find anything usefull yet.

This is what i am doing: docker run -d --name dev_sql-server-linux_temp -m 16g --cpu-quota=400000 -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=strongPassword@1" microsoft/mssql-server-linux:latest

I tried many other ways but nothing...

Please help me.

sqlservr: This program requires a machine with at least 3250 megabytes of memory. sqlservr: This program requires a machine with at least 3250 megabytes of memory. sqlservr: This program requires a machine with at least 3250 megabytes of memory.

JonathanImperato avatar Jul 24 '17 14:07 JonathanImperato

If you can, please use Docker for Mac or Docker for Windows instead of Docker Toolbox. Then, regardless of which you are using ultimately there is a VM under the cover that needs to have more memory allocated to it. You can do this through the Docker settings UI which is available through the system tray icon (the little whale). Just bump up the memory to 4 GB+ and restart the Docker VM.

twright-msft avatar Jul 24 '17 14:07 twright-msft

@twright-msft I am using the toolbox one because i am on windows and i do not have hyper-v so i can't install docker ce/ee edition...So is here an alternative?

JonathanImperato avatar Jul 24 '17 15:07 JonathanImperato

@twright-msft Should i edit it in VM VirtualBox?

JonathanImperato avatar Jul 24 '17 15:07 JonathanImperato

Docker Toolbox is fine if you can't use Docker for Windows. Yes, please change the amount of memory in the VM in Virtual Box. That should do the trick.

twright-msft avatar Jul 24 '17 15:07 twright-msft

@twright-msft once i do it, will i be able to access the database through microsoft sql server management?

JonathanImperato avatar Jul 24 '17 15:07 JonathanImperato

Yes, make sure you expose the port on the host using the -p parameter on Docker run. e.g. -p 1433:1433. Then you can connect to 'localhost' or to the IP address of your host. Note: If you have SQL Server running locally on your host too, you'll need to expose the container on a different port. e.g -p 1455:1433 or something like that and then connect to localhost,1455.

twright-msft avatar Jul 24 '17 15:07 twright-msft

thanks!

JonathanImperato avatar Jul 24 '17 16:07 JonathanImperato

@twright-msft what would be my c# connection string to link to a container called MyDB with the database called MyDB? Any idea?

JonathanImperato avatar Aug 01 '17 08:08 JonathanImperato

Should be something like this: "Data Source=MyDB;Initial Catalog=MyDB;Integrated Security=False;User Id=sa;Password=password"

Note: If you want to connect to the server name MyDB your application needs to be running in a container that is on the container virtual network so that the name resolution works. Otherwise use the container IP address or the host IP address if you are exposing the 1433 port through the host. Note: You should create a login for your application instead of using the sa login.

twright-msft avatar Aug 01 '17 14:08 twright-msft

How can i create a login?

JonathanImperato avatar Aug 02 '17 14:08 JonathanImperato

Once you connect with the SA login you can use CREATE LOGIN to create a new login. https://docs.microsoft.com/en-us/sql/t-sql/statements/create-login-transact-sql

twright-msft avatar Aug 02 '17 14:08 twright-msft

I tried to connect to my database without success. I used your connection string, tried the one generated from visual studio (after I connected to my db) and both not working. I am in localhost, my port is 1433, should I put it next to MyDB in server section (e.g. Server=MyDB,1433 or Server=MyDB:1433)?

JonathanImperato avatar Aug 03 '17 12:08 JonathanImperato

How do I increase the memory of the linuxkit in the new Docker for Windows option? :)

thomasmaurer avatar Oct 24 '17 20:10 thomasmaurer