Hello Kevin - I was charged with getting SS2022 installed on Ubuntu and, following your step-by-step instructions was invaluable. You have taken the pain out of attempting the same instructions from Microsoft. I look forward to your other video series entries on working with SQL Server on Linux. Thank you SO MUCH!
excellent, thank you I'm doing an ETL project and i have MySQL server as well as SQL server on my ubuntu server machine I will be doing the data work on my main machine
I tried several times to install MSSQL on Ubuntu 22.04 but always have the same error: /opt/mssql/bin/sqlservr: error while loading shared libraries: liblber-2.4.so.2: cannot open shared object file: No such file or directory 😖
The most likely reason is that you're actually pointing to the Ubuntu 20.04 packages list rather than Ubuntu 22.04. The Focal release (Ubuntu 20.04) had as part of its requirements for SQL Server 2022 libldap-2.4-2 specifically, and Ubuntu 22.04 removed version 2.4 in favor of version 2.5. You can check to see if this is the case by navigating to /etc/apt/sources.list.d/ and then running the command: "less mssql-server-2022.list" Inside there, it'll include a link to Microsoft's package server. If that includes /ubuntu/20.04/ in the domain, that's your culprit. First, uninstall mssql-server: "sudo apt remove mssql-server -y" Next, remove the mssql-server-2022.list file: "sudo rm mssql-server-2022.list" Then, add the Ubuntu 22.04 package link: "curl -fsSL packages.microsoft.com/config/ubuntu/22.04/mssql-server-2022.list | sudo tee /etc/apt/sources.list.d/mssql-server-2022.list" Now it should install the Ubuntu 22.04 version of SQL Server and not 20.04.
If it still doesn't work look into etc/apt/sources.list.d/additional.repositories.list and delete everything in there before installing MSSQL for 22.04.. That fixed my problem.
Thank you, Kevin. The video is great. Unfortunately, I'm noticing through stress tests that SQL Server on Ubuntu is 11x less performant than on Windows (with very similar resources: 4vCore, 16 GB RAM). Is there any configuration to make SQL Server perform better on Linux?
I do cover this in the next video in the series: ruclips.net/video/CznMCouSsM4/видео.html. In it, I cover most of the document Microsoft has put together on optimizing a Linux installation for SQL Server: learn.microsoft.com/en-us/sql/linux/sql-server-linux-performance-best-practices?view=sql-server-ver16 I will also say that, in talking to other people who have performed similar stress testing, I've heard numbers ranging anywhere from "approximately the same" to about 10% less performant on Linux. The biggest gap post-tuning was from someone using some powerful software (on-prem, double-to-triple-digit cores, direct-attached NVMe storage, TB+ of RAM, etc.), so that does come in as a factor.
That is a great question. I've just added them to the blog post that accompanied this video: 36chambers.wordpress.com/2023/12/26/video-installing-sql-server-on-ubuntu-22-04/ I'll do that for the other videos in this series as well, knowing that some of these commands differ a bit from the Microsoft documentation.
Hay Kevin I got this sudo apt-get install -y mssql-server Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package mssql-server Any Idea How to fix it?
Two things come to mind. 1. Make sure that you are using Ubuntu 22.04 instead of 24.04. 24.04 just came out, so SQL Server won't support it yet. 2. Make sure to add the mssql-server-2202.list file that I show in the video. Command line instructions are available at 36chambers.wordpress.com/2023/12/26/video-installing-sql-server-on-ubuntu-22-04/ if you want to follow along that way.
@@jacovaneck968 Same problem, actually trying to connect to microsoft packages url retrieves 403 Forbidden error after the steps described in this video.
You'd use "sa" as the username and the password you created when running mssql-config as the password. But before you can connect using SSMS, you'll need to go to the Options menu and trust the server certificate, as I show in a later video: ruclips.net/video/MunQ_TA6JBQ/видео.html
It does not. They're still single-instance with the recommendation that, if you want multiple instances on a box, to use multiple virtual machines or containers.
If running "sudo apt-get install -y mssql-tools18 unixodbc-dev" you get an error such as: ""Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?" just run "sudo killall apt apt-get" and rerun the command
When running the command to enable the sql agent it gives me the following error: The setting 'sqlagent.enable' is not supported. version del linux es : Ubuntu 22.04.5 LTS
@@KevinFeasel Thank you, I have a question, you know that I installed the Ubuntu server already with SQL, however I did not partition the disk and when I restored some databases on this new server it gave me little space. When I verified the path with the dh - h command: /dev/mapper/ubuntu--vg-ubuntu--lv is where the databases are stored, it indicates that there is only 3 GB left, I would like to know how I can expand said space with what I have on the hard drive, since the I made the virtual machine with a 300GB hard drive. Thank you greetings
@@YONEL30 The answer to that will depend on the hypervisor you're using (VMware, Hyper-V, Virtual Box, etc.). But something like the following may help give you a starting point: grumpytechie.net/2021/08/31/extending-disks-on-a-linux-virtual-machine/
@@samuelarias820 Correct. There might be a way to finagle installation of libraries SQL Server is expecting but they only officially support up to 22.04 at this time. They'll support 24.04 eventually but it will probably be sometime in 2025, based on when support for 22.04 came out.
On ubuntu 24.04 I think it'll not work after the config command, I was getting this /opt/mssql/bin/sqlservr: error while loading shared libraries: liblber-2.5.so.0: cannot open shared object file: No such file or directory
Yeah, it's likely that this will not work on Ububtu 24.04 as is. 24.04 isn't officially supported by Microsoft yet, as it just came out recently. I wouldn't expect official support for another year or thereabout. There may be a way to force installation but I wouldn't recommend it when you can run SQL Server on Linux in a Docker container or 22.04 VM as an alternative.
@@KevinFeasel i get the same error on 22.04 opt/mssql/bin/sqlservr: error while loading shared libraries: liblber-2.4.so.2: cannot open shared object file: No such file or directory
@@tshokelo1219 The error is different because that's a different version: 2.4 versus 2.5. Make sure you're using the Ubuntu 22.04 repo for Microsoft and that you've deleted any prior repos that might contain SQL Server. That's asking for the older version of OpenLDAP. Check for existing Microsoft repos in /etc/apt/sources.list.d/ and /etc/apt/sources.list.d/additional.repositories.list, remove them, and then add the repo specifically for Ubuntu 22.04. That should resolve this installation issue.
You'll want to check why it's failing. The easiest way to do that would be to read through the logs. The command to list the files in the log directory is: sudo ls -l /var/opt/mssql/log From there, look for the file named "errorlog" because that's the latest one. You may also check out any other files like errorlog.1, errorlog.2, etc. sudo less /var/opt/mssql/log/errorlog That will give you some indication what's causing the failure and allow you to troubleshoot further.
There are a couple possibilities here, but it boils down to your Odin account not having rights to run administrative tasks. First, is this your machine? If you didn't set up the box, can you get administrative access from whoever set it up? Second, if you did set it up yourself, did you initially create a different account? If so, try logging in with that other account first and then run the command: sudo usermod -aG sudo Odin That would give your Odin account rights to perform any administrative task on the machine. If you created it but didn't have any other initial account, how did you set this up? Bare-metal installation on a personal desktop/laptop? VM--if so, which service (VMware, Hyper-V, etc.)? If it's a cloud machine, what type? There may be some nuance to the setup that requires an additional step.
I downloaded it on the laptop and downloaded the Oracle VM virtualBox 7.0.14. I only have one user on the VM account. I did try the sudo command you mentioned as it still says the same respone "Not in the sudoers file". I also redownloaded Abuntu on the VM and created a new Username to see if that worked but it is still saying the same response. I've looked up on forum and some users are reporting the same issue.
It looks like with VirtualBox you might be able to use su directly. Try the following command: su - usermod -aG sudo Odin "su -" will make you the root user on the box. Run the command to grant yourself sudo rights. Then you'll want to reboot the VM. Based on an answer from: askubuntu.com/a/1440054. There's a little more detail on this at SuperUser: superuser.com/a/1755286
Hi, excelent video! It worked perfectly and It opend the database from local But now i would like to commect with this database outside the network, do you know how to do it? I would love an advice or some commands I could run I already open the port 1433 And I know that when connecting in SQL Management studio i should put the PublicIP:1433 And then the sa with the password But it still doesn't work
The short answer is, this is a networking problem and the only complete answer I can provide is "Sort out the network routing problem and you're good." That's a little glib but it will depend on how you're hosting SQL Server on Linux. - If it's bare metal in a corporate network, you'd want to make sure that there are no firewall devices preventing access to TCP 1433 on the Linux box. - If it's a cloud-based VM, check the network firewall. In Azure, for example, you have a couple of options. One is to create a private virtual network (VNet) that spans the Linux box and your machine, and use a point-to-site VPN to connect. The simpler alternative is to go into Network settings for the VM and, in the network security group section, create a port rule opening up 1433 TCP to your IP address. AWS has similar settings but I don't know them off the top of my head, and I'm sure other cloud providers do as well. - If it's a VM on your host machine and you want to connect from the host (like I do in most of these videos), check the VM's network adapter. In Hyper-V, there's a default switch and if all of your VMs are on the default switch, they can communicate with one another as well as the host. If you have a different network topography, you'd have to sort that out. The same applies if you're using Virtual Box, VMware, or some other virtualization tool. - If it's a VM on your host machine and you want to connect from a different machine on your network, you'd have to set up a port forwarding rule between your host and the VM. That would require a bit of work (e.g., superuser.com/questions/1445288/port-forwarding-with-hyper-v-virtual-machine-on-windows-10 for Hyper-V). This is also where I say that I'm not a networking expert, but I didn't want to leave you hanging entirely. You might also be able to google some of the details in your particular case by adding specifics about the scenario to your search terms.
@@KevinFeasel Thank you very much for your answer, Sorry, I didn't specify my devices, where I am running Ubuntu- server is in a old pc that I have on my local network at home. And my main device is just a regular W11 machine, where I am trying to make this database to work. I am trying to make the database (ubuntu server) running at home and connect from my laptop when I am outside the network. I see the recommendations for virtual machines, does it really applies to my case? The ubuntu server is supposed to have already open the 1433 port (I run a command to open it) I will be definitely googling for more information. I am really new in this world of Linux, servers, and networking, but I am trying to learn.
@@omargarcia6356 If you ran ufw to open up port 1433 over TCP (like I show in a later video in the series: ruclips.net/video/MunQ_TA6JBQ/видео.html), try running ifconfig to get the IP address. Can you ping it from your other PC? Can you ping your PC's IP address from the Ubuntu server? These two will help you figure out if there's a network routing problem. At that point, I'd start looking at router-related questions: - Are they on the same network and subnet? - If so, does the router allow communication between devices on the network? - Also, does the router have port TCP 1433 blocked? Some routers allow you to block specific port usage on networks. - If the two devices are not on the same network and subnet, do you have anything set up to span across those networks? I'd consider it unlikely (but not impossible) that there's some sort of blocker on Ubuntu itself, such as a firewall rule preventing access. The most likely candidate is your home network setup.
If you mean you get an error that reads something like "the certificate chain was issued by an authority that is not trusted," that's simply saying that you are using a self-signed certificate, which is the default for SQL Server. If you are connecting from SQL Server Management Studio, you can tick the "Trust server certificate" box before connecting. If you're using Azure Data Studio, there's a Trust server certificate drop-down that you can set to True. I get into this in a little more detail during the video on firewalls and TLS in SQL Server on Linux: ruclips.net/video/MunQ_TA6JBQ/видео.html
Hi Kevin, My sql server wont start. Getting this error after setup: /opt/mssql/bin/sqlservr: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory If I try systemctl status mssql-server, I get /opt/mssql/bin/sqlservr: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory I have Ubuntu 22.04.3 LTS and is NOT on a VM. It is a direct install Any insight on what may be going on. Searching on error drives me in a loop. Thanks
Is it possible you installed SQL Server from the Ubuntu 20.04 repo instead of 22.04? It looks like that was a problem with trying to use earlier releases of SQL Server on Ubuntu 22.04 prior to Microsoft officially supporting it. If you want a quick and dirty solution, you can install libssl 1.1 with the following commands: wget nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb That said, it's not an ideal answer (see stackoverflow.com/a/73604364 for more info) and my hunch is that the installation repo is intended for an older version of Ubuntu which shipped with libssl 1.1.
@@KevinFeasel Thank you for the input. Appreciate that very much. I did verify that the installation is for 22.04. I also uninstalled the server and then went through re-installation process following your video. I will try out libssl that you mentioned. Thanks.
@@KevinFeasel Hi I have the same issue, I'm using Kernel: 5.15.0-107-generic x86_64 bits: 64 compiler: gcc v: 11.4.0 Desktop: Cinnamon 6.0.4 tk: GTK 3.24.33 wm: muffin vt: 7 dm: LightDM 1.30.0 Distro: Linux Mint 21.3 Virginia base: Ubuntu 22.04 jammy, I tried the quick and dirty solution but doesn't work, do you know any idea what could I do to solve th issue?.... thanks
@@cesarpedraza I'm not particularly familiar with Linux Mint, but given that it's based on Ubuntu 22.04, I'd expect things to work, including the installation of libssl.so.1.1 (as seen in forums.linuxmint.com/viewtopic.php?t=385941). In this case, what does "it doesn't work" mean? Does it mean you cannot install the library, that you get the same error message as before, or something else? And is the error message exactly the same as in the first comment?
The username for the admin account is sa. The password is whatever you would like it to be, as it's your machine. In practice, you would create different logins for users using the CREATE LOGIN and CREATE USER commands. If you created a new login and user that way, you can name the user whatever you'd like as well.
First, try setting the status to active again, just in case: sudo systemctl restart mssql-server Assuming it still fails to start, the best thing to do is to check the error log. This command shows you files in the installation directory: sudo ls -l /var/opt/mssql/log Then, you can find the error log, which is likely to be called either Errorlog or errorlog. Open the file (assuming it's called errorlog): sudo less /var/opt/mssql/log/errorlog Down near the bottom of that file, you'll see information on why the service failed to start.
Uninstalling is rather easy. This assumes you installed mssql-server, mssql-tools18, and unixodbc-dev. For Ubuntu: sudo apt remove mssql-server mssql-tools18 unixodbc-dev For Fedora: sudo yum remove mssql-server mssql-tools18 unixodbc-dev Then remove the SQL Server directory, as you may still have databases remaining. If SQL Server was installed into the default directory: sudo rm -rf /var/opt/mssql
It's whatever you set the password to be. There is no default password. At 6'05", you can see that I set the password to the phrase "WeNeedABetterPassword!!!1" but you'd probably want to use a better password than that.
And if you've forgotten the password, you can reset it if you have root access to the machine: www.sqlservercentral.com/blogs/reset-sa-password-on-sql-server-on-linux
Hello Kevin - I was charged with getting SS2022 installed on Ubuntu and, following your step-by-step instructions was invaluable. You have taken the pain out of attempting the same instructions from Microsoft. I look forward to your other video series entries on working with SQL Server on Linux. Thank you SO MUCH!
Worked EXACTLY as you said it would.... Thanks!
It works like a charm! Thank you for this!!!!
Thanks, worked perfectly
Thank you very much
Thank you so much! This has been a great help!
excellent, thank you
I'm doing an ETL project and i have MySQL server as well as SQL server on my ubuntu server machine
I will be doing the data work on my main machine
I tried several times to install MSSQL on Ubuntu 22.04 but always have the same error: /opt/mssql/bin/sqlservr: error while loading shared libraries: liblber-2.4.so.2: cannot open shared object file: No such file or directory
😖
The most likely reason is that you're actually pointing to the Ubuntu 20.04 packages list rather than Ubuntu 22.04. The Focal release (Ubuntu 20.04) had as part of its requirements for SQL Server 2022 libldap-2.4-2 specifically, and Ubuntu 22.04 removed version 2.4 in favor of version 2.5.
You can check to see if this is the case by navigating to /etc/apt/sources.list.d/ and then running the command: "less mssql-server-2022.list"
Inside there, it'll include a link to Microsoft's package server. If that includes /ubuntu/20.04/ in the domain, that's your culprit. First, uninstall mssql-server: "sudo apt remove mssql-server -y"
Next, remove the mssql-server-2022.list file: "sudo rm mssql-server-2022.list"
Then, add the Ubuntu 22.04 package link: "curl -fsSL packages.microsoft.com/config/ubuntu/22.04/mssql-server-2022.list | sudo tee /etc/apt/sources.list.d/mssql-server-2022.list"
Now it should install the Ubuntu 22.04 version of SQL Server and not 20.04.
If it still doesn't work look into etc/apt/sources.list.d/additional.repositories.list and delete everything in there before installing MSSQL for 22.04.. That fixed my problem.
Thank you so much, it worked smoothly.
Thank you!
"too cool for windows" had me dead right there 🤣
Worked like a charm
Thanks. The cp command saved me
Thank you so much. Please make a video on how to back up the database from the command line.
Thanks for the idea. I'll add it to my backlog.
thank you!
Thank you, Kevin. The video is great.
Unfortunately, I'm noticing through stress tests that SQL Server on Ubuntu is 11x less performant than on Windows (with very similar resources: 4vCore, 16 GB RAM). Is there any configuration to make SQL Server perform better on Linux?
I do cover this in the next video in the series: ruclips.net/video/CznMCouSsM4/видео.html. In it, I cover most of the document Microsoft has put together on optimizing a Linux installation for SQL Server: learn.microsoft.com/en-us/sql/linux/sql-server-linux-performance-best-practices?view=sql-server-ver16
I will also say that, in talking to other people who have performed similar stress testing, I've heard numbers ranging anywhere from "approximately the same" to about 10% less performant on Linux. The biggest gap post-tuning was from someone using some powerful software (on-prem, double-to-triple-digit cores, direct-attached NVMe storage, TB+ of RAM, etc.), so that does come in as a factor.
Hi Kevin, great video but where do I find the commands you use in the video?
That is a great question. I've just added them to the blog post that accompanied this video: 36chambers.wordpress.com/2023/12/26/video-installing-sql-server-on-ubuntu-22-04/
I'll do that for the other videos in this series as well, knowing that some of these commands differ a bit from the Microsoft documentation.
@@KevinFeasel Thanks for the quick response!
Hay Kevin
I got this
sudo apt-get install -y mssql-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package mssql-server
Any Idea How to fix it?
Two things come to mind.
1. Make sure that you are using Ubuntu 22.04 instead of 24.04. 24.04 just came out, so SQL Server won't support it yet.
2. Make sure to add the mssql-server-2202.list file that I show in the video. Command line instructions are available at 36chambers.wordpress.com/2023/12/26/video-installing-sql-server-on-ubuntu-22-04/ if you want to follow along that way.
did u come right ? im having this same issue
@@jacovaneck968 Same problem, actually trying to connect to microsoft packages url retrieves 403 Forbidden error after the steps described in this video.
well done, that is a great video. but I have a question when we want to connect from our MS SQL Management Studio, which password is entered?
You'd use "sa" as the username and the password you created when running mssql-config as the password. But before you can connect using SSMS, you'll need to go to the Options menu and trust the server certificate, as I show in a later video: ruclips.net/video/MunQ_TA6JBQ/видео.html
Does this version support database instances?
It does not. They're still single-instance with the recommendation that, if you want multiple instances on a box, to use multiple virtual machines or containers.
@@KevinFeasel Ok thank you very much
If running "sudo apt-get install -y mssql-tools18 unixodbc-dev" you get an error such as: ""Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?" just run "sudo killall apt apt-get" and rerun the command
Thanks man
When running the command to enable the sql agent it gives me the following error: The setting 'sqlagent.enable' is not supported. version del linux es : Ubuntu 22.04.5 LTS
There needs to be a 'd' at the end: sqlagent.enabled
@@KevinFeasel Thank you, I have a question, you know that I installed the Ubuntu server already with SQL, however I did not partition the disk and when I restored some databases on this new server it gave me little space. When I verified the path with the dh - h command: /dev/mapper/ubuntu--vg-ubuntu--lv is where the databases are stored, it indicates that there is only 3 GB left, I would like to know how I can expand said space with what I have on the hard drive, since the I made the virtual machine with a 300GB hard drive. Thank you greetings
@@YONEL30 The answer to that will depend on the hypervisor you're using (VMware, Hyper-V, Virtual Box, etc.). But something like the following may help give you a starting point: grumpytechie.net/2021/08/31/extending-disks-on-a-linux-virtual-machine/
@@KevinFeasel Kevin, the hypervisor I am using is Vmware exsi
@@KevinFeasel I would like to expand the 300gb disk I have to add an additional one for the sql path.
Would you like me to suggest some resources or guide you on how to start?
I currently have Ubuntu 24.04, does that mean I still won't be able to install SQL server?
@@samuelarias820 Correct. There might be a way to finagle installation of libraries SQL Server is expecting but they only officially support up to 22.04 at this time. They'll support 24.04 eventually but it will probably be sometime in 2025, based on when support for 22.04 came out.
@@KevinFeasel Thank you very much for the information, we are attentive in case new support is released.
On ubuntu 24.04 I think it'll not work after the config command,
I was getting this /opt/mssql/bin/sqlservr: error while loading shared libraries: liblber-2.5.so.0: cannot open shared object file: No such file or directory
Yeah, it's likely that this will not work on Ububtu 24.04 as is. 24.04 isn't officially supported by Microsoft yet, as it just came out recently. I wouldn't expect official support for another year or thereabout. There may be a way to force installation but I wouldn't recommend it when you can run SQL Server on Linux in a Docker container or 22.04 VM as an alternative.
@@KevinFeasel i get the same error on 22.04 opt/mssql/bin/sqlservr: error while loading shared libraries: liblber-2.4.so.2: cannot open shared object file: No such file or directory
@@tshokelo1219 The error is different because that's a different version: 2.4 versus 2.5.
Make sure you're using the Ubuntu 22.04 repo for Microsoft and that you've deleted any prior repos that might contain SQL Server. That's asking for the older version of OpenLDAP.
Check for existing Microsoft repos in /etc/apt/sources.list.d/ and /etc/apt/sources.list.d/additional.repositories.list, remove them, and then add the repo specifically for Ubuntu 22.04. That should resolve this installation issue.
and systemctl status mssql-server --no-pager
this service is enabled but not Active, Active is failed.
how to Active it?
You'll want to check why it's failing. The easiest way to do that would be to read through the logs. The command to list the files in the log directory is:
sudo ls -l /var/opt/mssql/log
From there, look for the file named "errorlog" because that's the latest one. You may also check out any other files like errorlog.1, errorlog.2, etc.
sudo less /var/opt/mssql/log/errorlog
That will give you some indication what's causing the failure and allow you to troubleshoot further.
Hey Kevin, I'm having an error message after I input the first command saying Odin is not in the sudoers file. Please help
There are a couple possibilities here, but it boils down to your Odin account not having rights to run administrative tasks. First, is this your machine? If you didn't set up the box, can you get administrative access from whoever set it up?
Second, if you did set it up yourself, did you initially create a different account? If so, try logging in with that other account first and then run the command: sudo usermod -aG sudo Odin
That would give your Odin account rights to perform any administrative task on the machine.
If you created it but didn't have any other initial account, how did you set this up? Bare-metal installation on a personal desktop/laptop? VM--if so, which service (VMware, Hyper-V, etc.)? If it's a cloud machine, what type? There may be some nuance to the setup that requires an additional step.
Thank you for your response, yes I downloaded the machine on my computer. I will try it now!@@KevinFeasel
I downloaded it on the laptop and downloaded the Oracle VM virtualBox 7.0.14. I only have one user on the VM account. I did try the sudo command you mentioned as it still says the same respone "Not in the sudoers file". I also redownloaded Abuntu on the VM and created a new Username to see if that worked but it is still saying the same response. I've looked up on forum and some users are reporting the same issue.
It looks like with VirtualBox you might be able to use su directly.
Try the following command:
su -
usermod -aG sudo Odin
"su -" will make you the root user on the box. Run the command to grant yourself sudo rights. Then you'll want to reboot the VM.
Based on an answer from: askubuntu.com/a/1440054. There's a little more detail on this at SuperUser: superuser.com/a/1755286
I got good news! i used the command "su" as you recommended and I was able to be the root user and download SQL!@@KevinFeasel
Hi, excelent video!
It worked perfectly and It opend the database from local
But now i would like to commect with this database outside the network, do you know how to do it?
I would love an advice or some commands I could run
I already open the port 1433
And I know that when connecting in SQL Management studio i should put the PublicIP:1433
And then the sa with the password
But it still doesn't work
The short answer is, this is a networking problem and the only complete answer I can provide is "Sort out the network routing problem and you're good."
That's a little glib but it will depend on how you're hosting SQL Server on Linux.
- If it's bare metal in a corporate network, you'd want to make sure that there are no firewall devices preventing access to TCP 1433 on the Linux box.
- If it's a cloud-based VM, check the network firewall. In Azure, for example, you have a couple of options. One is to create a private virtual network (VNet) that spans the Linux box and your machine, and use a point-to-site VPN to connect. The simpler alternative is to go into Network settings for the VM and, in the network security group section, create a port rule opening up 1433 TCP to your IP address. AWS has similar settings but I don't know them off the top of my head, and I'm sure other cloud providers do as well.
- If it's a VM on your host machine and you want to connect from the host (like I do in most of these videos), check the VM's network adapter. In Hyper-V, there's a default switch and if all of your VMs are on the default switch, they can communicate with one another as well as the host. If you have a different network topography, you'd have to sort that out. The same applies if you're using Virtual Box, VMware, or some other virtualization tool.
- If it's a VM on your host machine and you want to connect from a different machine on your network, you'd have to set up a port forwarding rule between your host and the VM. That would require a bit of work (e.g., superuser.com/questions/1445288/port-forwarding-with-hyper-v-virtual-machine-on-windows-10 for Hyper-V).
This is also where I say that I'm not a networking expert, but I didn't want to leave you hanging entirely. You might also be able to google some of the details in your particular case by adding specifics about the scenario to your search terms.
@@KevinFeasel Thank you very much for your answer, Sorry, I didn't specify my devices, where I am running Ubuntu- server is in a old pc that I have on my local network at home.
And my main device is just a regular W11 machine, where I am trying to make this database to work.
I am trying to make the database (ubuntu server) running at home and connect from my laptop when I am outside the network.
I see the recommendations for virtual machines, does it really applies to my case?
The ubuntu server is supposed to have already open the 1433 port (I run a command to open it)
I will be definitely googling for more information.
I am really new in this world of Linux, servers, and networking, but I am trying to learn.
@@omargarcia6356 If you ran ufw to open up port 1433 over TCP (like I show in a later video in the series: ruclips.net/video/MunQ_TA6JBQ/видео.html), try running ifconfig to get the IP address. Can you ping it from your other PC? Can you ping your PC's IP address from the Ubuntu server? These two will help you figure out if there's a network routing problem. At that point, I'd start looking at router-related questions:
- Are they on the same network and subnet?
- If so, does the router allow communication between devices on the network?
- Also, does the router have port TCP 1433 blocked? Some routers allow you to block specific port usage on networks.
- If the two devices are not on the same network and subnet, do you have anything set up to span across those networks?
I'd consider it unlikely (but not impossible) that there's some sort of blocker on Ubuntu itself, such as a firewall rule preventing access. The most likely candidate is your home network setup.
Hi I have an error with the sql ssl certificate
If you mean you get an error that reads something like "the certificate chain was issued by an authority that is not trusted," that's simply saying that you are using a self-signed certificate, which is the default for SQL Server. If you are connecting from SQL Server Management Studio, you can tick the "Trust server certificate" box before connecting. If you're using Azure Data Studio, there's a Trust server certificate drop-down that you can set to True.
I get into this in a little more detail during the video on firewalls and TLS in SQL Server on Linux: ruclips.net/video/MunQ_TA6JBQ/видео.html
@@KevinFeasel Hi thanks I solved this problem but, now I have another error that said "Login failed for user sa " Error 18456
@@patriciocampoverdeg.9171 Make sure you're using the correct password and have selected "SQL Authentication" as the authentication mechanism.
when i am trying to restart mssql-server service it requires password what is that can you please help me
If you are running sudo to restart your SQL Server instance, you will need to provide your Ubuntu user account's password.
Hi Kevin, My sql server wont start. Getting this error after setup: /opt/mssql/bin/sqlservr: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
If I try systemctl status mssql-server, I get
/opt/mssql/bin/sqlservr: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
I have Ubuntu 22.04.3 LTS and is NOT on a VM. It is a direct install
Any insight on what may be going on. Searching on error drives me in a loop.
Thanks
Is it possible you installed SQL Server from the Ubuntu 20.04 repo instead of 22.04? It looks like that was a problem with trying to use earlier releases of SQL Server on Ubuntu 22.04 prior to Microsoft officially supporting it.
If you want a quick and dirty solution, you can install libssl 1.1 with the following commands:
wget nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
That said, it's not an ideal answer (see stackoverflow.com/a/73604364 for more info) and my hunch is that the installation repo is intended for an older version of Ubuntu which shipped with libssl 1.1.
@@KevinFeasel Thank you for the input. Appreciate that very much. I did verify that the installation is for 22.04. I also uninstalled the server and then went through re-installation process following your video.
I will try out libssl that you mentioned.
Thanks.
@@KevinFeasel Hi I have the same issue, I'm using Kernel: 5.15.0-107-generic x86_64 bits: 64 compiler: gcc v: 11.4.0 Desktop: Cinnamon 6.0.4
tk: GTK 3.24.33 wm: muffin vt: 7 dm: LightDM 1.30.0 Distro: Linux Mint 21.3 Virginia
base: Ubuntu 22.04 jammy, I tried the quick and dirty solution but doesn't work, do you know any idea what could I do to solve th issue?.... thanks
@@cesarpedraza I'm not particularly familiar with Linux Mint, but given that it's based on Ubuntu 22.04, I'd expect things to work, including the installation of libssl.so.1.1 (as seen in forums.linuxmint.com/viewtopic.php?t=385941). In this case, what does "it doesn't work" mean? Does it mean you cannot install the library, that you get the same error message as before, or something else? And is the error message exactly the same as in the first comment?
@@KevinFeasel It's mean that continue show me the same error when I try to start the mssql service
The username and password, what are the ones I should put there?
The username for the admin account is sa. The password is whatever you would like it to be, as it's your machine.
In practice, you would create different logins for users using the CREATE LOGIN and CREATE USER commands. If you created a new login and user that way, you can name the user whatever you'd like as well.
Thank you, and with your help, I was able to do that
@@KevinFeasel
bro mine is not working , the status is not active
First, try setting the status to active again, just in case:
sudo systemctl restart mssql-server
Assuming it still fails to start, the best thing to do is to check the error log. This command shows you files in the installation directory:
sudo ls -l /var/opt/mssql/log
Then, you can find the error log, which is likely to be called either Errorlog or errorlog. Open the file (assuming it's called errorlog):
sudo less /var/opt/mssql/log/errorlog
Down near the bottom of that file, you'll see information on why the service failed to start.
is this just the server and not the management studio? lol im lost
This is just the server, yes. You cannot install SQL Server Management Studio on Linux, though you can install Azure Data Studio.
@@KevinFeasel damn... i guess I'll just go back to windows
At The Moment, Warning! The 97.87 GiB filesystem mounted at / has only 1.51 MiB of free disk space
You should make a video on how to delete it.
*An install and delete for Fedora would be appreciated.
Uninstalling is rather easy. This assumes you installed mssql-server, mssql-tools18, and unixodbc-dev.
For Ubuntu: sudo apt remove mssql-server mssql-tools18 unixodbc-dev
For Fedora: sudo yum remove mssql-server mssql-tools18 unixodbc-dev
Then remove the SQL Server directory, as you may still have databases remaining.
If SQL Server was installed into the default directory: sudo rm -rf /var/opt/mssql
what is the password for the login...?
It's whatever you set the password to be. There is no default password. At 6'05", you can see that I set the password to the phrase "WeNeedABetterPassword!!!1" but you'd probably want to use a better password than that.
And if you've forgotten the password, you can reset it if you have root access to the machine: www.sqlservercentral.com/blogs/reset-sa-password-on-sql-server-on-linux