Can not connect to a database (localhost)

Hello,

I am trying to connect a database (localhost) though, I can not do it.
Please help me out! I am quite new to Wappler.

I was going through steps of this link.

Then I got this screen.

I’m using MAMP by the way.

Thanks!

Hi @Miwa!
Are you sure you entered the right server address in the database connection dialog? What have you entered there?

Thank you so much for your prompt reply.

I did as follows.

Server Address:http://localhost:8889
Port: (empty)

As long as I checked phpmyadmin, the server address was above.
16

Where am I wrong?

You should remove the port from the address field.
If you need to use a port, different than the default one, enter it in the port field.

So the right config would be:

Server address: localhost
Port: 8889

Screenshot_63

Thank you.

I did as you mentioned, however, I got another error.

What should I do next?

That’s a permissions error :slight_smile: The user (username) you are using does not permissions to access this database. Please check this in your database/users setup.

1 Like

I could find the problem source. Now I could connect a database!

Thank you so much!!!:blush:

2 Likes

Hi All, i need support for my database connection. My server target if using FTP to my hosting company and connection is successful. on same server, i have created database, database user and ODBC connection. but i i try Wappler to connect to database, it gives error. Can any one have some ideal?



Try removing the http:// @yannicko from the address just put in localhost

Hello,
what’s the error returned?

Hi , I have tried to remove http: from server address. still not working. Please screenshots below. i have checked my hosting server as well for ODBC conection settings. The error says “invalid target configuration” while connection is successful




Are you sure the same target you defined your ftp connection in is selected in the Target dropdown, when making the database connection?
Screenshot_56

yes please see below.
And further in databsae type i cannot see MySQL option. i can see only MySQL ODBC.



That is because of the server type you selected. Mysql will appear if are using a PHP server, while in your case it is the Mysql ODBC option.

Thanks , any idea why database connection not getting done please?

The error says that there is something wrong with the target, and the files required to make the database connection cannot be found there (uploaded on the target).
Please double check if everything is properly defined in your target configuration.

This has all the symptoms of the web root not being set properly in your FTP settings

Take a look at the file manager, select your target source and take a look at the root of the file tree

image

The path shown should be the root of your website, often by default FTP shows a level above so the target directory will need to be updated in your FTP settings

1 Like

Thanks for your help. issue is fixed. the default FTP account was not referring to default root directory on web server. i created new user and uploaded file again. connection got successful now.

1 Like

A post was split to a new topic: Database connection problem