Unable to run MySql Server 8.0.32 from excel vba
Hello, I am getting started with MySQL, which I want to drive via vba code in Excel 365 (Office v 32-Bit), on a Windows 10 (64-Bit) PC. I am 'Administrator'. My steps:
-
Downloaded MySQL Server 8.0.32 from Community Downloads.
-
Used MySQL 8.0 Command Line Client to create my DB: "mytestdb1" and SHOW DATABASES returned "mytestdb1" in the Command Line Client. So I think MySQL downloaded ok.
-
VBE/Tools/References as follows: VBA; MS Excel Object Library 16.0; OLE automation; MSOffice Object Library 16.0; Microsoft ActiveX Data Objects 6.1 Library. (I also tried selecting an older driver).
-
MySQL 8.0 Command Line Client turned off.
-
I ran this short Sub:
Dim con As ADODB.Connection
Dim strCon As StringSet con = New ADODB.Connection
strCon = "DRIVER={MySql ODBC 8.0 Unicode Driver};"
strCon = strCon & "SERVER=localhost;"
strCon = strCon & "DATABASE=mytestdb1;"
'strCon = strCon & "Port=3306;" '(sometimes included)
strCon = strCon & "USER=root;"
strCon = strCon & "PASSWORD=9HT0vLX%O=ktnD;"
'strCon = strCon & "OPTION=3;" '(sometimes included)
Debug.Print "strCon = "; strCon
con.Open strCon
[Debug.Print output --> strCon = DRIVER={MySql ODBC 8.0 Unicode Driver};SERVER=localhost;DATABASE=mytestdb1;USER=root;PASSWORD=9HT0vLX%O=ktnD;]
Run-time error Error Report Box reads"-2147467259 (80004005) Automation error. Unspecified error."
Re-starting the computer --> no change
This is my first experience of these procedures.
I'm prepared to get an error report going, but there are several and I'd like to know what to do first. Thanks!