Installing and configuring SQL Server 2008 R2 Full-Text Search through Linux (Ubuntu 16) - sql

I am wondering if there is a way I can install and configure SQL Server 2008 R2 Full-Text Search through Linux (Ubuntu 16.04). Possibly using the sqlcmd cli interface for SQL Server vNext could work? Haven't been able to find info to manage that. Seems like I need SSMS to do it which I don't think is compatible with Linux systems. Hopefully that isn't the case. My laptop is Linux only and might have some drastic performance issues if I try to install Windows 10 partition (Also I don't own this laptop, as it is a bit dated and I am already dealing with some concerning slowdown from time to time). I am hoping to avoid having to use a Windows OS to do this.

To install sqlcmd on Ubuntu 16.04 do the following:
sudo su
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-tools.list
exit
sudo apt-get update
sudo apt-get install mssql-tools unixodbc-dev-utf16
You should be able to run sqlcmd after this.

Related

How to install MSSQL-Server on Ubuntu 22.04

I am trying to install MSSQL-Server on my Ubuntu 22.04. I know that it does not currently support Ubuntu 22.04. I need to find a workaround to install the software as I don't want to downgrade.
I tried installing but it keeps giving me dependency errors. How do I solve it? Any help would be appreciated.
Unfortunately, at this time, SQL Server 2019 only works on Ubuntu 20/21. 22.04 is not supported at this time.
So either you will have to use Ubuntu 20 or, as others have stated, use Docker Containers.
You can install Docker into Ubuntu 22.04. It's a multi-step process, but it isn't that difficult.
Install Docker Engine on Ubuntu (follow the Install using the repository section)
https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository
Install SQL Server Container
https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-ver15&pivots=cs1-bash
That should do it.
Also, in link #2, read further below on how to connect to your docker image to run SQLCMD from within the container.
Like SQL Server 2019, you cannot install the SQLCMD tools directly into your Ubuntu 22.04 installation. But the Docker container image contains the sqlcmd tool for you to be able to connect to the database.
Or, you can use Visual Studio Code with the SQL Server (mssql) extension and it can connect to your SQL Server instance in your running Docker container.
The connection string would be:
"Server=localhost;Database=your database name;User Id=user id;Password=password"
You can leave out the Database setting if you just want to connect to the default database.
If you create any databases, you can then connect to them directly by specifying the name.
I also have same problem like this. I also tried downgrading Openssl to 1.1.1k and 1.1.1s but still not works. And finally I found this explanation
https://github.com/microsoft/msphpsql/issues/1419#issuecomment-1303626500
So, keep use OpenSSL 3.0.2 and you just need to change the SECLEVEL to 0 instead of 1 in /etc/ssl/openssl.conf
[system_default_sect]
CipherString = DEFAULT:#SECLEVEL=0
And it works, now I can connect to SQL Server using Ubuntu 22.04.
Looked at this
and it has worked for me!
So worth giving it a shot
cd /opt/mssql/lib
ls -la
sudo rm libcrypto.so libssl.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 libcrypto.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.1 libssl.1.1
If libssl is not installed, try:
sudo apt install libssl1.1
Update: I had issues connecting using libssl1.1, so I switched to 1.0 after performing the previous steps, so I also did the following:
sudo systemctl stop mssql-server
sudo systemctl edit mssql-server
Added:
[Service]
Environment="LD_LIBRARY_PATH=/opt/mssql/lib"
Then:
sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /opt/mssql/lib/libssl.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /opt/mssql/lib/libcrypto.so
Then started mysql-server and things just worked fine!

Linux Subsystem can't install and recognize packages

I am using windows and didn't wanted to switch to linux. I still wanted to learn it so I downloaded ubuntu subsystem for windows. It works fine and I can also execute linux commands on it. But the problem is I can't check my pip version using "pip --version" command also I can't access nodejs . It says that node isn't recognized. But it is working fine on my cmd windows terminal. How can I make it work ? Do I really have to download all these packages again after running "sudo apt update" command.
Yes, you have to download all these packages again for Ubuntu-WSL. That is because WSL is not compatible with windows executable, just like Ubuntu is supposed to be.

How do i connect to a ODBC Oracle database?

I have information about the connection like username, password, host, port, SID and i know that is an oracle database but i don't know how to connect. I am on lubuntu 18.04.
You can use sqlplus to connect to remote Oracle db server and execute queries.
For this purpose, firstly install sqlplus by the information written in https://help.ubuntu.com/community/Oracle%20Instant%20Client page. You will basically execute below commands.
First of all download the .rpm files from here: https://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html
For x64 version
https://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
For x86 version
https://www.oracle.com/technetwork/topics/linuxsoft-082809.html
Then install alien to convert .rpm files into .deb package and install the package automatically.
sudo apt update
sudo apt install alien
After downloading into a directory, execute below commands;
Currently last version that is available for Linux is 18.3. So for example, rpm files can be as below.
Assuming that you are in your home directory and downloaded files into that location.
sudo alien -i /home/yourusername/oracle-instantclient18.3-basic-18.3.0.0.0-1.x86_64.rpm
sudo alien -i /home/yourusername/oracle-instantclient18.3-sqlplus-18.3.0.0.0-1.x86_64.rpm
sudo alien -i /home/yourusername/oracle-instantclient18.3-devel-18.3.0.0.0-1.x86_64.rpm
(Mostly 3 of them are installed)
Then test your connection as below
sqlplus username/password#//dbhostname:port/SID
sqlplus64 username/password#//dbhostname:port/SID (If you installed sqlplus x64 version)
Also the given above Ubuntu documentation page tells about solutions of problems if you encounter any of them like below part.
If you execute sqlplus and get "sqlplus: command not found", see the
section below about adding the ORACLE_HOME variable.
If sqlplus complains of a missing libsqlplus.so file, follow the steps
in the section "Integrate Oracle Libraries" below.
If sqlplus complains of a missing libaio.so.1 file, run
sudo apt install libaio1
or, if you're installing the 32 bit
instant client on 64 bit,
sudo apt install libaio1:i386
After all these operations, you can also install "rlwrap" and integrate with sqlplus to bring the auto-completion and decent input history.
sudo apt install rlwrap
rlwrap sqlplus username/password#//dbhostname:port/SID
Or you can define an alias.
alias sqlpl='rlwrap sqlplus username/password#//dbhostname:port/SID'
sqlpl
Lastly, don't forget to replace sqlplus with sqlplus64 if you have installed x64 version.

Install SQL Server 2012 on ubuntu

How can I install SQL Server 2012 on ubuntu?
You can't install MSSQL Server 2012 on Ubuntu. It's not on supported OS list.
But you can install MSSQL Server 2017. This doc page has instructions:
Import the public repository GPG keys:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
Register the Microsoft SQL Server Ubuntu
repository:
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)"
Note
This is the Cumulative Update (CU) repository. For more information
about your repository options and their differences, see Change source
repositories.
Run the following commands to install SQL Server:
sudo apt-get update
sudo apt-get install -y mssql-server
After
the package installation finishes, run mssql-conf setup and follow the
prompts to set the SA password and choose your edition.
sudo /opt/mssql/bin/mssql-conf setup
Tip
If you are trying SQL Server 2017 in this tutorial, the following
editions are freely licensed: Evaluation, Developer, and Express.
Note
Make sure to specify a strong password for the SA account (Minimum
length 8 characters, including uppercase and lowercase letters, base
10 digits and/or non-alphanumeric symbols).
Once the configuration is done, verify that the service is running:
systemctl status mssql-server
If you plan to connect remotely,
you might also need to open the SQL Server TCP port (default 1433) on
your firewall.
To install the mssql-server Package on Ubuntu, follow these steps:
Enter superuser mode. ...
Exit superuser mode. ...
Run the following commands to install SQL Server: sudo apt-get update sudo apt-get install -y mssql-server.
After the package installation finishes, run the configuration script and follow the prompts.
for more details look Installing SQL on Ubuntu

How to check LAMP is installed or not?

I am newbie in vps. I installed centos 6.5 64bit. one hour ago and installed Apache, php, mysql successfully. now I have to install phpmyadmin. It requires something called LAMP. I don't know if LAMP is already installed by default with centos or I have to manually install it. What is the ssh command to check it if LAMP installed or just answer yes or no.
UPDATE:
[understood]
That blogger confused me by separating LAMP with comma.
If LAMP was correctly installed, i.e., PATH is already set for php,mysql and apache2, then run following commands from terminal:-
php -v // Return PHP version
apache2 -v // Returns apache version
mysql --version // Returns mysql version
if all of the above command returns their respective versions, then it means LAMP is installed.
BUT if it doesn't then there might be two cases:-
1) LAMP might be installed but is not added to path.
2) LAMP is not installed, Install it.
As for the first case, if it is installed but not runnable from terminal, then just run following commands to see where LAMP components are installed:-
1) Find file with name "apache2" in your pc. It will return list of path where a file name called "apache2" exists. You can then cross examine it further.
sudo find / -name apache2
2) Run the above same command to find file "mysql" and follow the same procedure further.
sudo find / -name mysql
3) For PHP:-
sudo find / -name php
LAMP stands for Linux, apache, Mysql, PHP, if you've installed apache, mysql and PHP correctly on a linux system you have LAMP already set up.
If you want to check whether the above mentioned dependecies are installed or not
To check whether php is installed or not
php5 -v
For Apchae
/usr/sbin/apache2 -V
If any of the mentioned dependencies are not install and you want to install the LAMP use the following command,
sudo apt-get install lamp-server^