I have recently migrated my ubb forum website to a new web hosting server, I have placed the files on new server and I think directory structure is right and also set up the database through phpmyadmin, and changed config file accordingly but still I am getting this error
UBB Message We encountered a problem. The reason reported was
Script:
Line#:
SQL Error:
SQL Error #:
Query: Unable to connect to the database!
I think all the info that i have filled in config file here:
'DATABASE_SERVER' => 'db.aa.0000000.hostedresource.com',
'DATABASE_USER' => 'abcd',
'DATABASE_PASSWORD' => 'cccc',
'DATABASE_NAME' => 'ssddd',
is correct because I tried to connect to db through another script and it did work and retrieved the data so I am totally confused what I am doing wrong.
Are you sure that this is the correct configuration data? Did you perhaps copy it into your config file wrong? That would seem to be the most likely source of errors (e.g. the script that worked had similar, but slightly different values which were actually correct and on first blush look like the ones in your config file).
Related
I have reinstalled phpAdmin (due to another issue) and updated wp-config with the correct names for DB, user name, password, etc, but now I cannot access the wordpress site (www.enablie.co.uk, www.enablie.co.uk/wp-admin or http://www.enablie.com/phpmyadmin).
I have tried adding the repair code
define('WP_ALLOW_REPAIR', true);
But still cannot access via : http://www.enablie.co.uk/wp-admin/maint/repair.php.
I am also getting this error when trying to access sql -
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
On Chrome is is showing a basic version of the site (broken styles) when not logged in, but get the EEDC as soon as try to log in. On Safari I have the EEDC immediately.
I assume I have just done something stupid, but most errors seem to suggest naming errors in the config file which I know is not the case. I have also checked the db still exists via mysql to ensure that there is not a problem there.
I assume that the re-install removed something from the overall settings that I now need to manually reconfigure, but I can't find any guidance that points me where to look so would appreciate some help on what I need to change. Much appreciated!
I rebooted by instance and that seemed to fix the issue.
I am a beginner in PHP and MVC, I just developed a project in CodeIgniter and it was complete and working superb on my local machine. So I registered a domain and uploaded my site to the live server and the exported the db by sql file, and there are were a ton of problems that I faced, and I am still stuck.
It Won't accept the database information from the config file 'database.php', although it was correct, then I found out that I needed to set 'db_debug' to FALSE, so i did that and i changed the 'db_driver' from 'mysql' to 'mysqli' because of a deprecation error, and then had to comment out an elseif block in the BASEPATH/system/database/drivers/mysqli/mysqli_driver.php in the 'escape_str' function, and then that dear error was gone. And the site was running.
But as I tried to signup the is_unique validation rule wasn't working because it kept giving back the error, even when there was no such value in the db table, then I tried deleting that rule and then the form was submitted successfully but there were no entries made in the db. My guess is that the db connection is not being established.
I have loaded the 'database' library in the autoload.php.
Now the site is still working great on my local machine, and I can't figure out the problem.
When you set db_debug to false, it just doesn't show the database errors, but doesn't actually solve anything. Actually it was a newly registered domain, so it took some time to assign the user to the db, i guess. because when I tried again after a few hours, The database connection succeeded, and it is working great.
I have a big problem with connecting to mysql database. I tried everything and nothing worked.
If i try to connect on localhost with xampp to db on kohana (3.1.2), i get this error:
Database_Exception [ 0 ]: ~ MODPATH\database\classes\kohana\database\mysql.php [ 67 ]
but if i try run it on some server, it runs there and i dont know why, because everything is same (except db user and password).
I thought that it can be with mysql config, but i dont know what there.
I just came across this problem and figured out what it was so even though this question is old, people having this problem should know the answer.
Basically when you get this error its because your using a version of php 5.5+.
mysql_connect(...) is a depreciated function starting in php 5.5 and above so the call in the framework is wrapped around a try/catch but the output from the catch doesn't give you any details about the error for whatever reason but if you remove the try/catch you'll see the real php error is simple saying mysql_connect is depreciated and will be removed in the future and to use mysqli instead.
To fix this open index.php in your root and basically you need to change the error_reporting(...) call to tell it not to error on depreciation errors which you can do like so to report all errors except warnings and deprecations.
error_reporting(E_ALL ^ (E_WARNING | E_DEPRECATED));
Another fix is to change your database config file to connect via PDO instead of mysql.
I checked in Kohana 3.2, and there it means it can't connect to your database and throws an exception on that. But just go to the line 67 of the mysql.php file and check if the exception is triggered just after trying to connect to the DB.
Check your credentials in database config and make sure your MySQL server is up and running.
I have implemented a phpGrid that works in my dev environment but just keeps saying:
Error: Could not connect to the database
in production
I am logging failed attempts at MySQL connections in the logs on and if I put in a dodgy username and password in the conf.php files username/password it does not show up in the log (I've tested the log is working by attempting to connect with bad credentials via a terminal.
The host is just "localhost" I am using PDO connections elsewhere within my code and the are all connecting using "localhost" so I see now reason why this would be a problem.
In the conf.php I've turned on:
define('DEBUG', true);
And on my grid I have:
$dg -> enable_debug(true);
But I just keep getting this stupid error that tells me nothing about what's really going on...
It happened to me as well. Finally I was able to figure out. The reason is mySQLi was not enabled on the server. I enabled it and it works now.
Sorry, i cannot add a commant and sorry for my english.
If you are using PHP 5.5 try:
error_reporting=E_ALL^E_DEPRECATED
at top of the page for the time being.
For the files on your production machine: proof if they are still in utf-8 encoding
all,
My log4php gets this error in a new server environment.
PHP Warning: log4php: [LoggerAppenderPDO:default]: Failed connecting to database. Closing appender. Error: could not find driver in ../log4php/LoggerAppender.php on line 283
I have the same settings for log4php (1. config.xml file 2.same log4php version) as my local development, which works perfectly. I tried simply log to a file in the new server, it works, which means the log4php lib has no problem. And I can even log to the database in the new server from my local script using local log4php lib, which means my server can recognize log4php logging.
I think this should related to the authentication to the database from the server itself. But have no idea what is the problem and how to solve it. Any idea?
Work around:
After some searches and tests(script using PDO not mysqli to connect to the database,reference here) , I confirm the problem is caused by lacking of pdo_mysql related driver, as akluth pointed out. I tried to re-install php5-mysql, but it failed, I tried to modify php.ini, got more errors. I think that is because the mysql-cluster settings maybe different from normal mysql. As the new server is a production server, we decide not to touch it and move the scripts to other server with normal mysql settings.