Solve the problem of SQL Server limit 2G memory limit installation

records the method of installing sqlserver when the minimum memory limit for Linux installation is not met once.

1. If you previously installed sqlserver but did not succeed, uninstall first (if not installed, skip)

sudo yum remove mssql-server
sudo rm -rf /var/opt/mssql/
sudo rm -rf /opt/mssql/

2. Download the offline installation file (remember: do not install online)

3. Enter the downloaded file directory to execute the installation command

yum localinstall mssql-server-14.0.3030.27-1.x86_64.rpm

4. Break the memory limit

1) enter sqlserver directory CD /opt/ MSSQL /bin/

2) backup sqlservr file mv sqlservr. Old

3) USES python2 to modify the memory bound binary file (python3 does not support this)

oldfile = open("sqlservr.old", "rb").read()
newfile = oldfile.replace("\x00\x94\x35\x77", "\x00\x80\x84\x1e")
open("sqlservr", "wb").write(newfile)

5. Sqlserver configuration

sudo /opt/mssql/bin/mssql-conf setup

will run into permission issues :(if not skipped)

execute: chmod 777 sqlservr and then start the service systemctl start mssql-server

then check sqlserver status: systemctl status mssql-server

6. Connect to database:

After the

installation is complete, login with sa may fail to log in

this is a password policy issue, you just need to reset the password for sa

1) stop sqlserver: sudo systemctl stop mssql-server

2) switch directory: CD /opt/ MSSQL /bin

3) reset password command:./mssql-conf set-sa-password

4) after completion, restart sqlserver service: sudo systemctl start mssql-server

is done here (one more way, one more possibility. Good luck!)

Read More: