Shopware database connection not working from CLI - symfony

I have a working Shopware installation running on my server and I am trying to execute some commands from the terminal through ssh. The Shop itself runs perfectly fine, so the database connection is correct. However, when I try to run CLI scripts like bin/console plugin:list I get An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory. I feel like the CLI is trying to connect to the DB via socket and not via TCP. However, I am clueless where to look or change the behaviour. Any suggestions?

Have you tried to set your database host to 127.0.0.1 instead of localhost?
There is a forum post about the same issue:
https://forum.shopware.com/t/bin-console-an-exception-occurred-in-driver-sqlstate-hy000-2002-no-such-file-or-directory/67109

Related

Meteor app hosted on Cloud9 - How to connect to the MongoDB with Robomongo?

I have an app built with Meteor in Cloud9. And i want to connect to the MongoDB database of the the app using Robomongo, but i cant get it working..
I run the app by typing "meteor --port $IP:$PORT", and it runs ok.
When i type "meteor mongo" in the Cloud9 terminal it shows:
So i figure the MongoDB is running on port 8081?
Then on Robomongo, i enter the actual app URL and port, but it fails.
This is the error i get:
And this is when i click "Show error details":
Remove the fully qualified URL from the address. In your case, only have meteor-appname-username.c9users.io instead of https://meteor-appname-username.c9users.io/
In the advanced tab, give in the default database name (in your case: meteor)
Source

Symfony doesn't find pdo_sqlsrv driver

I have one problem with Doctrine (or with my server configuration, I don't know where is the problem) in my Symfony2 web. I have been looking for an answer since several days but I haven't found it yet.
I need to connect my symfony web to a remote Microsoft SQL database through Doctrine. For this reason, I have added the "database_driver: pdo_sqlsrv" param in app/config/parameters.yml, but when I try to execute (in my Mac) a command like:
php bin/console doctrine:database:create
or
php bin/console doctrine:generate:entities AppBundle/Entity/Product
I get the following error:
[Doctrine\DBAL\Driver\PDOException] could not find driver
[PDOException] could not find driver
I have checked the phpinfo and the driver doesn't appear (only mysql, sqlite). I don't know if it's possible to add MSSQL, because in Microsoft SQL Server Functions (PDO_SQLSRV) appears that it needs to be running on a Windows.
Is not possible to access a mssql database without Windows? (If yes, how can I do it).
Would I need a Windows hosting?
Thanks in advance.
I'm using sql server on my last project.
here is what i've done to make it work on my dev environment
install pdo-dblib
composer require leaseweb/doctrine-pdo-dblib
configure doctrine to use the driver_class from the lib above instead of refering the sql_serv driver
driver_class: Lsw\DoctrinePdoDblib\Doctrine\DBAL\Driver\PDODblib\Driver

sqlite3 cannot open database file, running Centos, flask uwsgi nginx

I have a fairly simple flask app which runs fine on my local machine. The app uses sqlite3. I am trying to deploy to a CentOS machine running nginx and uwsgi. The app starts but when I try to access the site through chrome, it raises an exception:
sqlite3.OperationalError: unable to open database file
I believe I have all the permissions correct, the user starting the app has ownership of the database file. All the directories have 777 permissions. The database has 665 permissions. nginx is started using sudo.
I have combed through all the existing posts about this kind of thing. People talk about permissions, but I am pretty sure I have those correct. The name of the file is correct.
DATABASE = 'sqlite:////home/.../firstDB.db'
I get the same error if the database points to a nonexistent file. What else could be going wrong?
So it turns out that the file name prefix of sqlite/// is incorrect. I don't understand this, as it worked before. I just put the file name only and it works now.

unable to connect with database

I have downloded some code of symfony from github. I have configured all the things.
I have created the database using command
php app/console doctrine:database:create
I have created the database also but when I am trying to log in or register then I am not registering when I am looking at profiler then it shows that no query has been executed. what should I do ?
Check your parameters_dev.ini file inside config and confirm whether the setting s are correct or not ? have you already created the database? can you upload some more code for details?
Check your port and try type 127.0.0.1 instead of localhost in parameters file, it's strange but it works for me.
Did you create the schema after you created the database?
php app/console doctrine:schema:create
What do the logs (app/logs/dev.log or app/logs/prod.log) say?

Symfony 2 Project Receiving [PDOException] General Error: 2050

[PDOException]
SQLSTATE[HY000]: General error: 2050
example:dbextra:install [--drop]
Database is setup properly, pdo is up and running, pdo_mysql is up and running, redis is up and running, elasticsearch is up and running...
If I look in my parameters.ini or I load the page and look under db in Symfony2 it tells me that everything is running fine. But I can't get dbextra:install to work and my app simply will not write to the database even though all the logs are saying that it IS writing to the database.
My app has a user name and password login and the ability to create new users. It correctly loads the forms and allows you to create a new user... but never actually writes that info to the database (even though it's saying it IS writing it to the database.)
Checked all the settings and all the servers are functioning normally (otherwise the app wouldn't run at all.)
The only error message I can get is that one.
Any ideas?
Someone using Ubuntu with Symfony2 will ABSOLUTELY run into this problem. So I thought I´d take a moment to explain the solution.
Symfony2 requires PDO... and it requires MySQL... but you can get pretty damned far without actually having pdo_mysql. If you just have PDO and MySQL installed... your application will probably run... but it will never write to the database.
And if you do a search for PDO_MySQL Ubuntu... you'll find a lot of outdated links to old versions of pdo_mysql that won't function properly with MySQL 5.5.
The solution is to run:
apt-get install php5-mysql
And then just restart apache and that will get rid of the error.

Resources