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) b>
p>
wget https://packages.microsoft.com/rhel/7/mssql-server-2017/mssql-server-14.0.3030.27-1.x86_64.rpm
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)
exit()
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!)