Fix Excel for Mac Cannot Connect to MySQL Through SQL Server ODBC
Question details
The user is unable to connect Excel for Mac to a local MySQL database via Microsoft Query, experiencing connection timeouts and syntax errors when specifying the port.

- Product
- Excel for Mac
- Device & OS
- Mac
- Scenario
- Setting up a System DSN to import data from a MySQL database (localhost or port 3306) into Excel.
- Observed behavior
- The From SQL Server ODBC connector times out when attempting to connect. Formatting the IP and port with a colon (e.g., 127.0.0.1:3306) produces an immediate syntax error, while other configurations result in a timeout.
Verify that your MySQL server is running properly and accepting TCP connections on port 3306. You will also need administrator privileges on your Mac to install and configure new ODBC drivers.
Install and Use the Official MySQL ODBC Driver
The SQL Server ODBC connector is designed exclusively for Microsoft SQL Server. To connect to a MySQL database successfully, you must use the dedicated MySQL ODBC driver.
Attempting to use a SQL Server driver to connect to a MySQL database will result in connection timeouts or syntax errors because the underlying communication protocols are different.
Visit the official MySQL website and download the 'MySQL Connector/ODBC' version that matches your Mac's architecture (Intel or Apple Silicon).
Run the downloaded installer package and follow the on-screen instructions to install the ODBC driver on your Mac.
Open the ODBC Administrator app on your Mac. Go to the System DSN tab, click 'Add', and select the newly installed MySQL ODBC driver instead of the SQL Server driver.
Fill in your MySQL server details using 127.0.0.1 for localhost, enter 3306 in the port field, and provide your database credentials.
Open Excel for Mac, navigate to the Data tab, select 'New Database Query', and choose your newly created MySQL DSN to import your data.

Format SQL Server Port Syntax Correctly
If you are actually attempting to connect to a Microsoft SQL Server instead of MySQL, you must use the correct comma syntax for the server and port.
Try WPS Office for Lightweight Data Management
If configuring complex ODBC drivers and troubleshooting Microsoft Query on Mac becomes too frustrating, consider switching to WPS Office. It provides a highly compatible, fast, and user-friendly spreadsheet environment for managing complex datasets.
- 1. Download the Installer: Visit the WPS Office website and download the Mac version of the software.
- 2. Install WPS Office: Open the downloaded package and drag the WPS Office icon to your Applications folder.
- 3. Open Your Spreadsheets: Launch WPS Spreadsheet and open your existing Excel files directly with perfect formatting retention.

Frequently Asked Questions
Can I use the SQL Server ODBC driver to connect to a MySQL database?
No. The SQL Server ODBC driver is strictly designed for Microsoft SQL Server databases. You must download and install the official MySQL Connector/ODBC driver to establish a connection to a MySQL database.
Why do I get a syntax error when typing the port number in the SQL Server connector?
The SQL Server ODBC connector on Mac requires a comma (,) to separate the server IP address and the port number (e.g., ServerIP,Port). Using a colon (:) will cause an immediate syntax error.
Why does my database connection attempt result in a timeout?
Timeouts occur when the database server is not reachable. This could be because the MySQL service is stopped, it is not configured to accept TCP connections on the specified port (usually 3306), or a firewall is blocking the traffic.




