Could not connect to the database

Website URL

http://cashhunger.great-site.net/

Error Message

The Following errors occurred:

  • Could not connect to the database.

Other Information

Im trying to install my Admin Panel, but i always get that error. I tripled check the username, database name and password, all of them are good, but for some reason, the user doesnt have the rights to write or something…

Welcome

Please provide more info.

Are you sure that’s all?

5 Likes

Hello. Yes, i spent already hours to check everything, and everything is just fine. I did the same thing on localhost, and its working perfect

Well, this is the most likely reason

2 Likes

I think the user from infinityfree doesnt have “Grant Access”, and sadly, i cant create another one…

Every hosting account has one database user that has access to all your databases.

But that user can only access the contents of the databases. It cannot create new databases, users, or change permissions, so there is no “grant” ability.

The message “Could not connect to the database” could mean anything. Is there any more details you can get from your application as to why it cannot connect to the database?

6 Likes

I tried with another admin panel, one of my apps, and now i get this error:

quicky.great-site.net is currently unable to handle this request.

HTTP ERROR 500

But the flow is, after uploading the files, the admin panel installer should appear right when you enter the URL. So something is wrong in this webhost

Oh, and i forgot to mention that, when you see the installation wizzard on the website, it will create your database. If you said it cannot create new databases, i should first insert the SQL tables and content into the database? Which is pretty hard cause idk what changes apply that installer

What admin panel are you trying to install?

Also for error 500, you’ll need to turn on full errors to see what the problem is:

The problem isn’t with the server, it’ll be with the code being run. Trust me I know how frustrating it is.

6 Likes

Oooh okay, thank you, so i found the issue:
Warning : require(/home/vol13_5/infinityfree.com/if0_38573136/htdocs/vendor/composer/autoload_static.php): Failed to open stream: No such file or directory

But the thing is, when i upload that file with Filezilla, it is disappearing instantly :expressionless:

A HTTP ERROR 500 just means your PHP code crashed. Please try enabling display_errors to try and see if you can get a real error message.

99%+ of all website software doesn’t need to create databases. You can just create the database beforehand using whatever tools you want, and then tell the website software to use that database.

So it seems very unlikely to me that your website software needs that ability.

If you do, copying over your local database is a good workaround. But again, I would be surprised if it was necessary.

All I have seen so far is a vague error message generated by your website software, and website software outright crashing. It could indeed be caused by a hosting issue, but it’s just as likely to be a problem with your website software, or your configuration. But as long as I have no idea why you get these errors, I cannot point fingers to anything.

6 Likes

Warning : require(/home/vol13_5/infinityfree.com/if0_38573136/htdocs/vendor/composer/autoload_static.php): Failed to open stream: No such file or directory

But the thing is, when i upload that file with Filezilla, it is disappearing instantly :expressionless:

Could be a number of things. But this thread might help you out

8 Likes

Yeah, ive seen that post, but its not my case. Im uploading the file in the htdocs fileon that domain

Ok, but theres more than that in the article.

Is the file size within the allowed limit per file (1 MB for php and html)?

5 Likes

Digging a bit deeper, I found an old post that looks similar:

But obviously without know the specific script your trying to set up, I can’t say for certain if its the same problem

3 Likes

No, the dimension is 1.23MB

Really?

That’s a PHP file

And the rule is:

1.23 is more then 1

6 Likes

That’ll be why its deleted.

you can sometimes make it smaller by regenerating your Composer files without the --optimize-autoloader option.

5 Likes

Done! I reduced the file size, and now, 2 more things… How can i Enable php Symlink function, and Disable Open BaseDir function ?