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.
23
questions
0
votes
0
answers
31
views
My Magento SQL is taking 500% of the CPU
I am facing an issue with my SQL database which take 500% of the CPU.
I have taken a screenshot of the process list.
Error:
[2024-06-02T06:00:17.313192+00:00] main.ERROR: SQLSTATE[HY000] [2002] ...
0
votes
1
answer
59
views
Product list export without admin access
The title probably seems suspicious but this is an above-board question:
I routinely visit a company's Magento auction storefront and it's pretty time consuming to get through all of their categories ...
1
vote
1
answer
34
views
DATABASE RELATED ERROR" SUCH AS SQLSTATE[HY000][2002]
Why do some Magento 2 installations encounter database-related errors, such as "SQLSTATE[HY000] [2002] Connection refused" or "Table 'magento.x' doesn't exist"?strong text
2
votes
2
answers
1k
views
Magento and MySQL: Access denied for user 'username'@'localhost' (using password: YES)
I am setting up an existing Magento site to run locally. The site uses MySQL, which I have installed and running on MacOS. I created a user doing the following:
> $ mysql -u root
CREATE USER '...
1
vote
1
answer
598
views
How to execute multiple DB queries?
My query is:
/**
* @var \Magento\Framework\DB\Adapter\AdapterInterface
*/
private $connection;
$query =
<<<SQL
LOCK TABLE {$tablename} WRITE;
...
1
vote
1
answer
1k
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 ...
0
votes
1
answer
316
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: ...
0
votes
1
answer
141
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?
1
vote
1
answer
21
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 ...
0
votes
2
answers
29
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\...
0
votes
1
answer
370
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
0
votes
0
answers
305
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 ...
3
votes
2
answers
3k
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, ...
2
votes
1
answer
212
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 ...
1
vote
0
answers
133
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 ...
0
votes
0
answers
137
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, ...
0
votes
1
answer
90
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 ...
0
votes
0
answers
152
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 ...
1
vote
1
answer
2k
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 ...
3
votes
2
answers
4k
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 ...
2
votes
0
answers
94
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 ...
2
votes
1
answer
909
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 ...
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\...