I am working on an Excel VBA project where I connect to a MySQL server using ADODB, but I can't figure out how to add the port information to the connection string. My connection code works as I've connected to other DB's, but I recently moved to my local computer where I have multiple connections with each residing on a different port. Here is my current connection string:
''''''''''''''''''''''''''''''''''''''''''''''''
' My Laptop Connection
''''''''''''''''''''''''''''''''''''''''''''''''
Public Const server_name As String = "127.0.0.1:5353" 'Enter your server name here - if running from a local computer use 127.0.0.1 or localhost
Public Const database_name As String = "juice" 'Enter your database name here
Public Const user_id As String = "root" 'Enter your user ID here
Public Const password As String = "Password1" 'Enter your password here
Public Const MySQLConnectStr As String = "DRIVER={MySQL ODBC 5.3 ANSI Driver}" _
& ";SERVER=" & server_name _
& ";DATABASE=" & database_name _
& ";UID=" & user_id _
& ";PWD=" & password _
& ";OPTION=16427"