SQL Server on M1 based Mac [closed] - sql-server

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 11 days ago.
Improve this question
I am trying to install SQL Server on M1 based Mac with Docker.
https://debugsolutions.wordpress.com/2021/03/17/using-sql-server-on-m1-based-mac-with-docker/
Made it all the way to end of step 5, but my container won't connect. I am getting:
1/08/02 01:31:47 [launchpadd] INFO: Launchpadd is connecting to mssql on localhost:1431
2021/08/02 01:31:47 [launchpadd] WARNING: Failed to connect to SQL because: dial tcp 127.0.0.1:1431: connect: connection refused, will reattempt connection.
2021/08/02 01:31:48 [launchpadd] WARNING: Failed to connect to SQL because: dial tcp 127.0.0.1:1431: connect: connection refused, will reattempt connection.
2021/08/02 01:31:49 [launchpadd] WARNING: Failed to connect to SQL because: dial tcp 127.0.0.1:1431: connect: connection refused, will reattempt connection.
2021/08/02 01:32:41 [launchpadd] INFO: Extensibility Log Header:
2021/08/02 01:32:41 [launchpadd] WARNING: Failed to load /var/opt/mssql/mssql.conf ini file with error open /var/opt/mssql/mssql.conf: no such file or directory
2021/08/02 01:32:41 [launchpadd] INFO: DataDirectories = /bin:/etc:/lib:/lib32:/lib64:/sbin:/usr/bin:/usr/include:/usr/lib:/usr/lib32:/usr/lib64:/usr/libexec/gcc:/usr/sbin:/usr/share:/var/lib:/opt/microsoft:/opt/mssql-extensibility:/opt/mssql/mlservices:/opt/mssql/lib/zulu-jre-11:/opt/mssql-tools
2021/08/02 01:32:41 Drop permitted effective capabilities.
2021/08/02 01:32:41 [launchpadd] INFO: Polybase remote hadoop bridge disabled
2021/08/02 01:32:41 [launchpadd] INFO: Launchpadd is connecting to mssql on localhost:1431
2021/08/02 01:32:41 [launchpadd] WARNING: Failed to connect to SQL because: dial tcp 127.0.0.1:1431: connect: connection refused, will reattempt connection.
2021/08/02 01:32:42 [launchpadd] WARNING: Failed to connect to SQL because: dial tcp 127.0.0.1:1431: connect: connection refused, will reattempt connection.
2021/08/02 01:32:43 [launchpadd] WARNING: Failed to connect to SQL because: dial tcp 127.0.0.1:1431: connect: connection refused, will reattempt connection.
How can I fix this?
The command I ran at end of step 5:
docker run --cap-add SYS_PTRACE -e ‘ACCEPT_EULA=1’
-e ‘MSSQL_SA_PASSWORD=Password.1’ -p 1433:1433 --name azuresqledge
-d mcr.microsoft.com/azure-sql-edge

` replace ' in docker command
$ docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=Password.1' -p 1433:1433 --name azuresqledge -d mcr.microsoft.com/azure-sql-edge

A bit late to the party but if you don't want to resort to using the cutdown Edge edition I found away to get SQL Server Linux going using an open source tool called Lima and Rosetta as the VM: https://dev.to/srburnham/forget-azure-sql-edge-on-a-m1-mac-run-full-blown-sql-server-linux-instead-a-how-to-6d2

Related

virt-manager GUI is not opening

I have ubuntu 18.04 server in which i have installed below packages to setup kvm:
qemu-kvm libvirt-bin bridge-utils virtinst virt-manager
Virt-manager is failing to open with below error:
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
**(virt-manager:3026): Gtk-WARNING : 14:09:54.999: cannot open display:
I have logged into server with -X option and in my sshd_config file, X11Forwarding is yes.
libvirtd service is active and running.
Output of kvm-ok command is:
INFO: /dev/kvm exists
KVM acceleration can be used
Can someone help me fix it?

Error 20002 while trying to connect to a server through tsql (OS X)

I've been using this guide for connecting to database through pyodbc: https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-Mac-OSX
My config files look like this, in parallel with the tutorial:
In freetds.conf:
[MYMSSQL]
host = localhost
port = 1433
tds version = 7.3
In odbc.ini:
[MYMSSQL]
Description = Testing SQLServer
Driver = FreeTDS
Servername = MYMSSQL
In odbcinst.ini:
[FreeTDS]
Description=FreeTDS Driver for Linux & MSSQL
Driver=/usr/local/lib/libtdsodbc.so
Setup=/usr/local/lib/libtdsodbc.so
UsageCount=1
When I test the connection with "tsql -S MYMSSQL -U myuser -P mypassword", I get the error:
Error 20002 (severity 9):
Adaptive Server connection failed
There was a problem connecting to the server
Likewise, "isql MYMSSQL myuser mypassword" returns an error as well:
[ISQL]ERROR: Could not SQLConnect
EDIT: In the query console:
"SELECT ##SERVERNAME" returns "4a70ffff1294"
"SELECT ##SERVICENAME" returns "MSSQLSERVER"
"SELECT ##VERSION" returns "Microsoft SQL Server 2019 (RTM-CU8) (KB4577194) - 15.0.4073.23 (X64)"
tsql -S MYMSSQL
returns
locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Error 20002 (severity 9):
Adaptive Server connection failed
There was a problem connecting to the server
The server is running in a docker image. I am able to connect to it via pycharm's database tool with the 1433 port and the relevant password. Sadly, I'm not very experienced with managing servers. All help is much appreciated.
If you want to continue down that path, we need some more info. What's in your freetds.conf? Can you connect to your SQL Server from the machine you're trying to install FreeTDS on with telnet mssql.myhost.com 1433?
However, I find it easier to avoid using freetds.conf and odbc.ini, and just keep everything in Python. As long as you have properly configured odbcinst.ini, you should be able to do something like this:
import pyodbc
con = pyodbc.connect(
"DRIVER={FreeTDS};"
"SERVER=mssql.yourserver.com;"
"PORT=1433;"
"DATABASE=your_db;"
"UID=your_user;"
"PWD=your_pass;"
"TDS_Version=7.3;"
)
cursor = conn.cursor()
cursor.execute("SELECT 1")
for row in cursor.fetchall():
print(row)
Good luck!

Error: Failed to connect to localhost:1433 - connect ECONNREFUSED 127.0.0.1:1433 docker

I am using Docker to install SQL Server on Mac OS. But i have an error Error: Failed to connect to localhost:1433 - connect ECONNREFUSED 127.0.0.1:1433. I have set memory to 6GB, password is strong enough but it still not works.
I got the same issue when I've tried to connect Azure Data Studio to the container,
I used the command lsof -nP +c 15 | grep LISTEN
turns out that it listen on port 1401
So I wrote that in the field of the server "localhost, 1401"
and it works,
There is another solution,
which is in the docker PREFERENCES and its about the memory you have to give it at least 3.25 GB so that the SQL Server runs.

tsql login failed but management studio can connect

I'm trying to connect to a MS SQL Server instance using tsql (to troubleshoot not being able to connect with django-pymssql).
I can connect fine to the server (running on Amazon RDS, latest SQL Server version from on there) from a VM running SQL Server management studio, but from my native Ubuntu 15.10 env I get a login failed error.
Using the following:
tsql -H <hostname> -p 1433 -U <user> -P <mypassword>
I get:
locale is "en_GB.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Msg 18456 (severity 14, state 1) from EC2AMAZ-U1TAK71 Line 1:
"Login failed for user 'sa'."
Error 20002 (severity 9):
Adaptive Server connection failed
There was a problem connecting to the server
As I can connect in management studio with mixed mode auth using the same creds I'm suspecting this isn't the real error.
Anyone have any ideas how I can troubleshoot?
tsql -C shows:
Compile-time settings (established with the "configure" script)
Version: freetds v0.91
freetds.conf directory: /etc/freetds
MS db-lib source compatibility: no
Sybase binary compatibility: yes
Thread safety: yes
iconv library: yes
TDS version: 4.2
iODBC: no
unixodbc: yes
SSPI "trusted" logins: no
Kerberos: yes
Thanks loads for any pointers.!
(Accidentally posted this to AskUbuntu so have moved here. Sorry).
Answering my own question. Turns out it was down to the password being too long. I experimented with it, and any password longer than 30 characters didn't work. Seems to be a known issue with freetds.
Thanks.

MongoDB, issues with configuring and starting

I am new to mongoDB and i am trying to get it configured and running on my Ubuntu server. When i go and enter this command in my terminal
sudo service mongod start
I get the following output
start: Job is already running: mongod
So, when i try to enter the shell with
mongo
I get the following output
2015-02-24T14:54:39.557-0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-02-24T14:54:39.559-0800 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
I know I'm not working locally so I heard over to the mongod.conf file and change the following
port = 5000
# Listen to local interface only. Comment out to listen on all interfaces.
bind_ip = 10.0.1.51
Where bind_ip is now my ubuntu server and the port is 5000 as shown, so now i restart the service with
sudo service mongod restart
and outsputs
mongod start/running, process 1755
And now I try to renter back into shell with
mongo
and i still get the same error messages
MongoDB shell version: 2.6.7
connecting to: test
2015-02-24T15:01:26.229-0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-02-24T15:01:26.230-0800 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed
Can someone help me out with this issue? I've been going through the forums and nothing appears to be working. Thanks.
If anyone is having trouble, i looked into mongod --help and found the following solutions
mongod --smallfiles
or
mongod --nojournal
hope this helps anyone.

Resources