Mamp server connection

hi,

i’m trying to connect my web application onto a databank and it’s finding the data bank but i cannot connect to it,

i tried it with several users, ip dresses and so on.

has anybody done this already or can someone help me?

Show us your database connection code, maybe someone will spot the problem.

DNDatenbank = New MySQLCommunityServer

DNDatenbank.Host = DNConst_Datenbankhost
DNDatenbank.UserName = DNConst_Datenbank_Benutzername
DNDatenbank.Password = DNConst_Datenbank_Passwort
DNDatenbank.DatabaseName = DNConst_Datenbankname

If DNDatenbank.Connect Then
System.DebugLog (“verbunden mit mysql”)
Else
System.DebugLog (“nicht verbunden mit mysql:” + DNDatenbank.ErrorMessage.lowercase)
End If

DNDatenbank.SQLExecute(“set names utf8”)

That should actually work, but not with me somehow?

.debug[45530] : nicht verbunden mit mysql:can’t connect to local mysql server through socket ‘/tmp/mysql.sock’ (2)

die Fehler Meldung bekomme ich

In MAMP, have you enabled “Allow network access to MySQL”?

If so and you’re trying to connect to it from another machine, have you also switched it from “only on this Mac” to “from other computers”?

Does DNConst_Datenbankhost contain “127.0.0.1” if MAMP is on same machine as running application?

i always could see from other computers the webpages but it’s my first attempt to access a databank
where could i set these settings?
DNConst_Datenbankhost contains localhost, 127.0.0.1 isn’t accepted but i think it’s actually the same if 127.0.0.1 and localhost right?

the application has the user access and i don’t understand why it’s not connecting, everything is on one mac

There is extra security on the database, you need to enable network access to connect from Xojo. Only needs to be “only on this Mac” if you’re just running your Xojo built app on the same machine that MAMP is running on.

In the MAMP GUI select MySQL and make the changes I noted above to enable network access, Save your settings and make sure the MAMP services restart.

In DNConst_Datenbankhost you need to use “127.0.0.1” to force network access, “localhost” will not work and you will get the /tmp/mysql.sock error.

i cannot find the part where i can set the settings

but localhost is building the connection and 127.0.0.1 doesn’t want to connect to the data base

localhost can find it but not 127.0.0.1

In MAMP Pro 4.2 …

Might be different for you, depending on whether you’re using MAMP or an older version of MAMP Pro.

Also, what port have you got MySQL using in MAMP?

8889

Mama version is the latest 4.2.1

i cannot see the image
you have to upload it anywhere and comment the url

I’m not using mama pro…

Try adding …

DNDatenbank.Port = 8889

thanks

it worked