Newbie - Access denied for MySQL Connection

Website URL

http://maisumteste.000.pe/

Error Message

SQLSTATE[HY000] [1044] Access denied for user ‘if0_36567378’@‘192.168.0.%’ to database ‘sql208(dot)infinityfree(dot)com’

Other Information

I have 2 questions.
Question 1 - The .env file is:
DB_CONNECTION=mysql
DB_URL=_sql208(dot)infinityfree(dot)com
DB_DATABASE=if0_36567378_chama_o_samu
DB_USERNAME=if0_36567378
DB_PASSWORD=same show at MySQL Connection Details panel
DB_PORT=3306

Why i need to put 1 character at begining of DB_URL ? If i dont put that extra character, the error message displays:

SQLSTATE[HY000] [1044] Access denied for user ‘if0_36567378’@‘192.168.0.%’ to database ‘ql208(dot)infinityfree(dot)com’

Question 2 - Why i receive access denied, if i use the user/pass exactly from the MySQL Connection Details panel ?

Sorry about my poor english.
Anyone can help?

I see the topic: Failed to connect to Mysql:Access denied for user ‘epiz_33917567’@‘192.168.0.204’

Maybe its a same problem because i use the “password reset” link on the control panel page…

Yes, that would do it. Always reset the password from the client area, never from the control panel

3 Likes

Because your DB_URL is invalid.

Or rather, it’s not really a DB_URL to begin with. The DB_URL is a way to pass all the parameters needed to configure the database as a single value, instead of specifying them all separately. So you can pass all the parameters using a single value like mysql://username:[email protected]/my_database_name. Some hosting platforms configure connections like this.

If you only specify a single value, then PHP will understand that as being just the database name and will use default values for everything else. And there is no database with the name sql208.infinityfree.com, because that’s the database hostname, not the database name.

I would just remove the DB_URL parameter entirely, and use the individual settings. You have most of them already, but you should add the database hostname with the DB_HOST setting like so:

DB_HOST=sql208.infinityfree.com

See above. The database name is wrong. And “access denied” could mean your password is incorrect or you don’t have access to the given database. I don’t know if your password is correct, but the database name definitely isn’t, so I expect fixing the issue above will solve everything.

4 Likes

Thanks for the big help!!
The laravel lives!
Finaly!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.