Reputation: 73
I copied a Magento store to another provider and installed the database. Nothing special.
With testing always this error for the mysql database:
SQLSTATE[28000] [1045] Access denied for user ‘xx’@’localhost’ (using password: YES)
I found this program /httpdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php
and has this statement:
try {
$this->_connection = new PDO(
$dsn,
$this->_config[’username’],
$this->_config[’password’],
$this->_config[’driver_options’]
);
If I use the same statement with the same settings in a short test program on the same server, the connection works.
How is this possible? Is there something in PDO different working while called in Magento?
I forgot to write, this domain has only a shared IP address and a domain name (but no DNS yet), so I coupled this IP address to this domain name in windows hosts file. So domain www.xxxx.com exists on the internet already, I use xxxx.com in windows host file coupled to the shared IP address. In this way I tested always new websites without an transferred domain yet.
When I copy everything to my own server (localhost.com for Magento), I have to find it, all works well. So it has something to do with the situation at my provider ... but why it is working in my own test program for PDO with the same settings ?
$dsn = mysql:model=mysql4;initStatements=SET NAMES utf8;type=pdo_mysql;host=localhost;dbname=xxxx;active=1
Upvotes: 0
Views: 21679
Reputation: 1
Thanks for all the answers, but the solution was simple.
In the website of the previous provider was the password correct in local.xml
But the password given to me per email was wrong but impossible to see (little letter L and capital letter i, so that is l and I). So I mixed these passwords.
Lesson: check many times ...
Upvotes: 0
Reputation: 4980
did you try :
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'your_password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
or
GRANT ALL PRIVILEGES ON your_database.* TO 'user_name'@'localhost' IDENTIFIED BY 'your_password' WITH GRANT OPTION;
if you specified a BIND ADDRESS in my.cnf file which is an IP address, you should use IP address instead of localhost
Upvotes: 3