- Sql Server Express Management Studio
- Run Sql Server On Mac
- Microsoft Sql Server Express For Mac
- Microsoft Sql Server Express For Mac
- Microsoft Sql On Mac
- Sql Server 2014 Express For Mac
With SQL Server 2017, you can run SQL Server on Linux, and can even host your own docker container without using Windows at all (I am doing this on my Macs right now - and I wrote about it here). VS Code, Visual Studio, and Operations Studio now run natively on the Mac, so that can work for you too in some scenarios. Mar 06, 2018 Hello, SQL Server database engine is available for Windows and Linux OS, but not for Mac. You can use a Windows VM or Docker Container to run SQL Server.
I recently had to set up a MS SQL database on my Mac for a client project, if you ever have to do this here is a mini tutorial.
In this post I am using VMWare Fusion for virtualisation, but you could use something else and the instructions should be mostly portable.
Get a Windows VM
Go to https://www.modern.ie/en-us/virtualization-tools and download a VM (Virtual Machine) for your Mac. I will be using Windows 7 (the version of IE doesn't matter).
Install the virtual machine and log in.
Get MS SQL Express with tools
As you download the Windows VM you can also download the free version or MS SQL.
At the time of writing the tiny_tds gem - the gem needed to access MS SQL - only supports MS SQL up to version 2012. So version 2014 won't work.
Go to http://www.microsoft.com/en-au/download/details.aspx?id=29062 and download MS SQL Express 2012, make sure to get the version with tools (named something like ENUx86SQLEXPRWTx86ENU.exe).
Install MS SQL Express
If you downloaded MS SQL Express on your Mac, you will need to make it accessible to your Windows VM. If you are using Fusion you can simply drag and drop the installer to Windows.
Run the installer and just install the default components. Accept the defaults in all other screens.
Create a DB for testing
In Windows, open SQL Server Management Studio. Connect using the provided defaults, then:
- Right click on Databases
- Click on New Database
- Add a name e.g. Test
- Click OK
Enable SQL Authentication
Still in SQL Server Management Studio:
- Right click on the root of the tree e.g. IE11WIN7SQEXPRESS
- Select Properties
- Select Security
- Enable SQL Server and Windows Authentication mode
- Click OK
Create a database user
In Management Studio:
- Click on Security on the tree
- Right click on Logins
- Select New Login
- Add a use e.g. dbuser
- Select SQL Server authentication
- Add a password
Set user mappings
In the same screen:
- Click on User Mapping
- Check the previously created DB e.g. Test
- Click the ... button on the right
- In the pop up window, select Browse
- Check dbo and OK
- Select OK again
- Select db_owner on the bottom
- Finally click OK
You can then close Management Studio.
Enable TCP in Express
In Windows, open SQL Server Configuration Manager. Then:
- Click on SQL Server Network Configuration
- Click on Protocols for SQLEXPRESS
- Double click on TCP/IP on the right.
- Change Enabled to Yes
- Click on IP Addresses
- Scroll down all the way to IPAll
- Set the TCP Port e.g. 1433
- Click OK
Restart SQL (in the same window):
- Click on SQL Server Services
- Right click on SQL Server on the right and select Restart
We can now close SQL Server Configuration Manager.
Disable the Windows Firewall
In Windows:
- Go to the Control Panel
- Search for firewall and open the Windows Firewall settings
- Click on Turn Windows Firewall on or off on the left
- On the Home network settings, click on Turn off Windows Firewall
- Click OK and close the control panel
Find the IP address for the VM
In Windows:
- Click on the network icon on the bottom bar
- Click on Open Network and Sharing Center
- Click on the link on Connections e.g. Local Area Connection
- Click on Details
- Take note of the IPv4 Address e.g. 192.168.0.11 in my case, this is the IP our VM is running on
In Windows:
- Open the Network and Sharing Center as in the previous step
- Click on the link under Network if it says 'Public network'
- Click on Home network in the pop up window
- Click Next several times and then Finish
The Network should be set to 'Home network'
In the mac terminal test the connection to the Windows VM:
Note that the IP address will most likely be different on your machine.
This should give you a successful ping. If you get a timeout double check the network settings and firewall in Windows.
If you have an application that can connect to MS SQL on the Mac, I recommend testing the connection from there first before going to Rails. I am using Navicat in my case. Otherwise just skip this step.
In Navicat:
- Create a new connection for MS SQL
- Set the IP Address to your VM IP e.g. 192.168.0.11
- Set the port as set previously e.g. 1433
- Set Initial Database to the DB created previously e.g. Test
- Set User Name and Password as created previously
- Test the connection
Install freetds
In order to connect to MS SQL, we need to install the necessary libraries in our Mac. Install freetds using homebrew, in the Mac terminal:
Add the tiny_tds gem to your project
In your Gemfile:
Then:bundle
Set up the connection in Rails
In your database.yml
, add / modify an entry for using the MS SQL db:
Take care to set the values as set previously i.e. host, port, username and password.
When this is done, your Rails application should now be able to connect to the MS SQL Express server running on the VM.
Latest Articles by Our Team
Our expert team of designers and developers love what the do and enjoy sharing their knowledge with the world.
reinteractive is presenting at Dreamforce 2019!
How do you Successfully Manage a Software Development Project?
Receiving and processing inbound emails with Action Mailbox an...
reinteractive is Australia’s largest dedicated Ruby on Rails development company. We don’t cut corners and we know what we are doing.
We are an organisation made up of amazing individuals and we take pride in our team. We are 100% remote work enabling us to choose the best talent no matter which part of the country they live in. reinteractive is dedicated to making it a great place for any developer to work.
Sql Server Express Management Studio
Free Community Workshops
We created the Ruby on Rails InstallFest and Ruby on Rails Development Hub to help introduce new people to software development and to help existing developers hone their skills. These workshops provide invaluable mentorship to train developers, addressing key skills shortages in the industry. Software development is a great career choice for all ages and these events help you get started and skilled up.
Webinars
Webinars are our online portal for tips, tricks and lessons learned in everything we do. Make the most of this free resource to help you become a better developer.
Installfest
The Ruby on Rails Installfest includes a full setup of your development environment and step-by-step instructions on how to build your first app hosted on Heroku. Over 1,800 attendees to date and counting.
Development Hub
The Ruby on Rails Development Hub is a monthly event where you will get the chance to spend time with our team and others in the community to improve and hone your Ruby on Rails skills.
The OpenLink ODBC Driver for SQL Server (Express Edition is adistributed as a Disk Image (DMG) file. Simply double click on thedisk image 'mul6esql.dmg' to extract the installer mpkg file:
Figure 10.1. SQLserverDMG.png
Double-click on the mpkg file to run the installer and followingthe on screen instriuction as indicated below to complete theinstallation:
Figure 10.2. SQLpackage.png
Installer Welcome Dialog for the OpenLink ODBC Driver for SQLServer (Express Edition):
Figure 10.3. SQLinstall1.png
Please review the readme file for installation requirements andknown issues:
Figure 10.4. SQLinstall3.png
Please read the software license agreement before continuingyour installation:
Figure 10.5. SQLinstall4.png
Figure 10.6. SQLinstall6.png
Select destination volume for driver installation:
Figure 10.7. SQLinstall7.png
Choose to perform a custom or default installation of thedriver:
Figure 10.8. SQLinstall8.png
If you chose the custom option select which of the componentsbelow are to be installed:
Run Sql Server On Mac
Figure 10.9. SQLinstall10.png
Microsoft Sql Server Express For Mac
The Software must be installed as a user with Administrativeprivileges on the machine:
Figure 10.10. SQLinstall12.png
Microsoft Sql Server Express For Mac
After the driver has been installed you will be prompted for alicense file. If a license file already exists on the machine thenselect the 'use exisiting file' option. A trial (try) or full (buy)license can be obtain by selecting the 'try and buy' option whichloads our online try-and-buy web page:
Figure 10.11. SQLinstall14.png
To obtain the trial license you must be a registered user on theOpenLink Web site and login with the username (e-mail address) andpassword for that user. Click on the 'Shop' link to visit ouronline shop cart to purchases a full license if required:
Figure 10.12. SQLinstall15.png
Microsoft Sql On Mac
Click on the 'download license' button to obtain the licensefile immediately and save to your desktop. Alternatively an autoe-mail will be sent to the registered users e-mail address with alink to their OpenLink Data Space (ODS) where all trial and fulllicense files will be stored in the Briefcase for download at alater date.
Figure 10.13. SQLinstall16.png
Sql Server 2014 Express For Mac
Select the license file to be used for the installation:
Figure 10.14. SQLinstall18.png
Installation is complete:
Figure 10.15. SQLinstall19.png