postgres pg_dump not working - php

I have a VPS running centos 7 in which I have installed Postgresql-9.3. It was running fine for the last one year. Now, when I need to take a backup using pg_dump it is not working. It was working. I used
pg_dump -d <role_name> > <backup_file_name.sql>
It doesn't show any errors. But there is no backup file being created.
SQL Queries are working fine.
Also my project (based on Yii framework) is unable to connect with the database anymore. Shows
CDbException
CDbConnection failed to open the DB connection: could not find driver
It all suddenly happened and I am stuck.
None of the logs give me any hint. Where should I check to find out a solution?

As for second question - seems like you are missing php-postgress drivers, exactly as error message says. You can try installing them back, as described in this question: How do I enable php to work with postgresql?
As for the first - I think that you updated or removed some important packages from your system. Also it could be upgrade consequences.

Related

Fixing a PHP database connection failure with updated MySQL library

I spent some hours trying to solve a migration from CentOS 5.5 to 7 in which everything worked except PHP-based sites connecting to the MySQL server for a Web site. Perl worked fine. CLI commands worked fine. I tried every solution listed on Stack Overflow and elsewhere:
Make sure /etc/hosts contains localhost as the first entry for 127.0.0.1
Check that PHP is correctly pointing to the right socket
Try swapping localhost and 127.0.0.1 in the connection setup
Checked php.ini for any settings that differed between my functional CentOS 5.5 setup and the new stock CentOS 7 installation.
Annoyingly, I couldn't get PHP to dump errors, whether via Apache or elsewhere. It was all maddening.
After checking for the fifth time that I had the right drivers installed, I realized that there are two CentOS/yum packages: one is php-mysql; the other is php-mysqlnd, a native driver.
Uninstalling php-mysql, which is apparently outdated, but which is what I used in CentOS 5.5, and installed php-mysqlnd instantly fixed the problem.
I have been unable to find any other answers of this sort, so perhaps my situation is unique. But I wanted to document it in case someone else came across the same migration issue.

yii CDbException: CDbConnection failed to open the DB connection: could not find driver

I am trying to use the yii framework for a while. I have been referring - first-app-doc and yiic-doc.
I have read all the posts related to mine on "stackoverflow" but couldn't get any luck resolving my problem. Mostly because I am stuck on the .ini files and the pdo.
I have modified the config file-protected/config/main.php according to my database configuration. I am using the command line tool - yiic to create the model. It gives me 'http://hostname/path/to/index.php?r=user' to hit.
When I hit http://localhost/index.php?r=user; it gives CDbException - CDbConnection failed to open the DB connection: could not find driver in the browser itself. It seems like it can't find the pdo_mysql.
Also, I don't have the php.ini file in /etc/php5/, but I have different php.ini files in /etc/php5/cgi/, /etc/php5/apache2/ and /etc/php5/cli/.
Also, the php5-mysql package, I have it installed on my computer.
I have been trying and trying. This is like impossible to do.
I know this is a little old question now but hopefully it can help other people, I actually had the same issue I was using it on Google Compute engine where we set up the server and we found out you have to install sqlite PDO extension as well as the MySQL PDO extension.
More information is on my question: https://stackoverflow.com/a/24555366/817213
Hopefully this can help other people too.
1- try to access the database with MAMP or WAMP or XAMP, or even by command line first. you will then know if you need a username and password for that.
2- check what databases you have. you will know then if the database exists or not.
3- check the database connection string in the project if it's correct or not.

Installing php and mysql for Joomla - Can't get past installation

Trying to install Joomla 2.5.7 but I can't get past the Pre-Installation Check as it says: Database support: No
I've got mysql (5.5.24) and php (5.3.15) installed manually on a Linux machine (I don't want to use LAMPP). I've done this a few times before and checked everything is the same with my other working machines in terms of the packages and the php.ini file. I can also access the mysql fine.
Any suggestions on what I can try? Is there a way to find out what check it is failing on?
Argh! I did miss a package. A pretty vital one at that: php-mysql. Don't forget to restart web server.
Joomla checks what databases are supported by testing each type for a connection. One possible issue is that the way you have things set up the owner of the installation process does not have permission to use the databases.
Ooops sorry I didn't see that you had soled
Most CMS come with a sql database setup files. These files must be added to your mysql data. Or tables and users must be manually created.
Have you done this?? If not check manual for details.
http://linuxinternetworks.com/how-to-install-joomla-in-linux/
Comment, after trying, I am reading it too.

PHP PEAR GoogleMapsAPI DB Error: not found

I am running a LAMP server for my development environment on Ubuntu 11.10.
I installed pear's DB (I know its deprecated, but this Google maps API class requires it)...
I have installed it, but now every time I try to load this "HelloWorld" map I'm testing on, I get an error message DB Error: not found.
I checked my dsn string and it looks good, I changed the database table to the correct table I am using, etc.
Apache error log doesn't report anything for this problem.
Has anybody run into a similar problem, or have any ideas what the problem could be?
If you need to see any code, I'll post it...
The database driver you're using cannot be found. Check if you're using the correct one.

MySQL problem reconnecting (mysqld.exe) keeps giving error

Need some guidance figuring out what went wrong. I've been using mysql, phpmyadmin for just under a year on my home computer while I develop a webapp. 3 days ago I updated my windows vista with all the "wonderful" microsoft updates, security patches, etc...and now it's broke. I tried uninstalling all the upgrades, but there are 4 of them I can't unistall because microsoft says their "operating system" updates and can't be unistalled.
My system is: windows vista, php 5+, mysql 5.1, Apache 2+.
I can run my web app and it queries the database without any problems. However, when I run phpmyadmin to get into the database I get an error: "mysqld.exe has stopped working" and phpmyadmin crashes. I tried going to the command line for mysql to do a mysqldump to backup my database and it gives me an error "2013, could not connect to the server". If I restart the computer the webapp will work again. Basically, php can query the database, but if I try to get at the database through phpmyadmin, or the command prompt the mysqld.exe error occurs and blows mysql out.
Any ideas what's going on here? Any ideas how to get around this to backup the db, so I can reinstall mysql?. I'm really lost where to start. I don't really know if the updates caused the problem, or if the 4 updates that can't be unistalled are really the problem.
Any tips will be appreciated. thanks.
You could try using XAMPP. It has PHP, MySQL, Apache, and other stuff all in one easy to use package.
After a software/ hardware drivers update, it may happened that the service mysqld.exe crashes at each launch (usually with message: mysqld.exe encountered an error and needs to close)
Check the solution described here (it worked for me) if you wish to avoid mysql reinstall.

Categories