[SOLVED] Unable to connect to the database |
Good morning i have a Project in a subfolder , the system work fine but i cannnot connect to db , file env its ok and if i try to connect with adminer ( similar to Phpmyadmin ) and same credential of file env It connect. Wath can i do?
You need to show us your config database file setup to be able to help you.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
05-16-2021, 03:32 PM
(This post was last modified: 05-16-2021, 03:34 PM by InsiteFX. Edit Reason: Spelliing error )
Did you try the config database settings alone to see if they work?
Also the base_url in your env.txt should have an ending backslash on it \ You can try this to see if you can connect stand alone. PHP Code: <?php What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(05-16-2021, 03:32 PM)InsiteFX Wrote: Did you try the config database settings alone to see if they work?i Change your code : PHP Code: <?php
In your database settings in the .env change localhost to 27.0.0.1 and see if that works.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Did you do away with the .env file and try using the Config\Database.php settings?
This makes no sense, I use databases all the time and never have a problem. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(05-17-2021, 01:24 AM)InsiteFX Wrote: Did you do away with the .env file and try using the Config\Database.php settings?i try both config/database and env same problem (05-17-2021, 03:11 AM)pippuccio76 Wrote:i try to use the script at this tread :(05-17-2021, 01:24 AM)InsiteFX Wrote: Did you do away with the .env file and try using the Config\Database.php settings?i try both config/database and env same problem https://forum.codeigniter.com/thread-77479.html this is the error: mysqli::__construct(): Headers and client library minor version mismatch. Headers:50650 Library:50528 [url=https://www.google.com/search?q=ErrorException+mysqli%3A%3A__construct%28%29%3A+Headers+and+client+library+minor+version+mismatch.+Headers%3A50650+Library%3A50528][/url]
You have a mismatch with MySQLi try using a newer version of MySQLi and PHP.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |