Questions tagged [database-connection]

A database connection is a facility that allows client software to communicate with database server software, whether on the same machine or not. A connection is required to send commands and receive answers.

Filter by
Sorted by
Tagged with
1 vote
1 answer
40 views

How to execute multiple DB queries?

My query is: /** * @var \Magento\Framework\DB\Adapter\AdapterInterface */ private $connection; $query = <<<SQL LOCK TABLE {$tablename} WRITE; ...
user avatar
0 votes
0 answers
17 views

Split Database with Foreign key from another Database

I am using Split Database, where I have created 3 parts: Default Quote Sales. I have created one Table using db_schema.xml file from that I am creating an custom table, but I want to add a Foreign ...
user avatar
0 votes
0 answers
18 views

magento 2.4 connect to external database via url instead of host

I need to connect my magento to an external database. Normally I would simply call $data = ['host' => xxx, 'dbname' => xxx, 'username' => xxx, 'password' => xxx]; $this->...
user avatar
  • 129
0 votes
0 answers
16 views

Retrieving data from aws rds mysql database using mangento endpoint in python

I have the API end point and was able to retrieve the admin token using the curl script here. ! curl -X POST "https://website.com/rest/V1/integration/admin/token" \ -H "Content-...
user avatar
0 votes
1 answer
170 views

Magento 2: installation command not working

I am executing magento 2 install command but it show error SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento_saas.store_website' doesn't exist, query was: SELECT main_table.* FROM ...
user avatar
0 votes
1 answer
190 views

Magento 2.4.0 Installation Error

I am getting this error in during installation of Magento 2.4.0 on Live server. Please help if you can. Current version of RDBMS is not supported. Used Version: 5.6.49-cll-lve. Su pported versions: ...
user avatar
0 votes
1 answer
59 views

Change database in Resource model

I split my database on 3 parts. In my env php is set default, but in one of my model i need to connect to table wich located in different db. How can i change target db?
user avatar
1 vote
1 answer
18 views

How can I make images of an old Magento work with a fresh installation (with the old db attached)?

I dont know how exactly to put it in words, so heres my problem I have an old corrupted Magento server (2.3). I have installed a fresh Magento (2.3) and used the sql dump from the old one, the ...
user avatar
0 votes
2 answers
26 views

What is the query readers here i can't understand magento 2.3

I can't find the what query rendes here and i can't it is not readable so any can to find what query renders hear please tell what are the table involved here public function getCount(\Magento\...
user avatar
  • 300
0 votes
1 answer
105 views

How to properly replace database in Magento 2?

I want to connect my Magento 2 to a new database, I've updated the /app/etc/env.php What other steps do I need to take
user avatar
0 votes
0 answers
131 views

Which is the best way to use database connection in phtml file in Magento 2

Which is the best way to use database connection in phtml file in Magento 2 Only for fetching single result from the custom table table because most of the time I am facing error like "User ...
user avatar
  • 696
3 votes
2 answers
1k views

How do I get connection to database by entering Database details in Magento 2?

I want to get custom database connection by adding database details in my custom script without using ResourceConnection. In Magento 1 we can do like this $conn = new \mysqli($servername, $username, ...
user avatar
2 votes
1 answer
112 views

Run Magento 2 cron with a different database user

Is it possible to run Magento 2 cron tasks under a different database user? This user will be able to connect to the same database as the website itself, and have exactly the same privileges; perhaps ...
user avatar
  • 279
1 vote
0 answers
58 views

magento 2 custom connection needs to be manually closed?

I have created a second database on the same server as magento database, then I've created a module that fetches data from the second database. In order to fetch data from the second database I have ...
user avatar
  • 121
0 votes
0 answers
103 views

Magento 2 : How connect Magento with Neo4j Graphical Database

Does any one know how to connect Magento 2 with Neo4j Graphical Database ? There is a PHP client library (composer require graphaware/neo4j-php-client:^4.0) which i have updated in Magento project, ...
user avatar
  • 1,725
0 votes
1 answer
45 views

How to create a complete group tab to admin?

I want to add a group tab in system > configuration > general > general. This tab will contain a text area where the user will be able to modify the text. This text area will be connected ...
user avatar
0 votes
0 answers
116 views

Do I need to manually close database connections?

I have a shop (Magento 1.9) with ~40.000 products. Every night they will be imported/updated via cronjob. There are other cronjobs that do various database operations as well. In my import script ...
user avatar
  • 600
1 vote
1 answer
1k views

Magento 2.2 - Fatal error: Uncaught Error: Call to undefined method Magento\Framework\App\ResourceConnection::load()

Fatal error: Uncaught Error: Call to undefined method Magento\Framework\App\ResourceConnection::load() in /var/www/html/magento2_dev/vendor/magento/framework/Model/AbstractModel.php:536 Just adding ...
user avatar
2 votes
2 answers
2k views

How to recover env.php file in Magento 2?

is there any way to recover the env.php file. As my file deleted unexpectedly when editing using command line. Now file is empty and showing with 0 size in the ftp. As i don't have the backup of the ...
user avatar
  • 195
2 votes
0 answers
72 views

Problem connecting to db after securing phpmyadmin with htaccess & htpasswd

I recently having an idea of securing my phpmyadmin portal, So i added htaccess and htpasswd to add another layer of protection [![enter image description here][1]][1] And I realized that my web ...
user avatar
  • 173
2 votes
1 answer
574 views

Magento 2 master slave connection for DB

I am planning to enable Master and slave connection on my Magento site. Magento team suggest me to check my 3rd party and custom modules support this master/slave config or not. I am not sure how can ...
user avatar
  • 3,036
2 votes
1 answer
2k views

Magento 2 - read and write connection for custom query

I am using Magento 2.2.5 EE. I need to write some custom queries Select and Insert I know how to write custom query, its simple: Create new connection: $objectManager = \Magento\Framework\App\...
user avatar
  • 8,795