Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9241679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:24:52+00:00 2026-06-18T08:24:52+00:00

I am having trouble with zend framework and connection with database, I’m trying to

  • 0

I am having trouble with zend framework and connection with database, I’m trying to create a login, the table is created, and the code apparently is fine, but gives me this:

An error occurred
Application error
Exception information:

Message: SQLSTATE[HY000] [1045] Access denied for user 'onetag51_teste'@'localhost' (using  password: YES)
Stack trace:

#0 C:\xampp\Zend\library\Zend\Db\Adapter\Pdo\Mysql.php(109):   Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 C:\xampp\Zend\library\Zend\Db\Adapter\Abstract.php(860): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 C:\xampp\Zend\library\Zend\Db\Adapter\Abstract.php(930): Zend_Db_Adapter_Abstract->quote('pass1', NULL)
#3 C:\xampp\Zend\library\Zend\Auth\Adapter\DbTable.php(449): Zend_Db_Adapter_Abstract->quoteInto('`password` = ?', 'pass1')
#4 C:\xampp\Zend\library\Zend\Auth\Adapter\DbTable.php(368): Zend_Auth_Adapter_DbTable->_authenticateCreateSelect()
#5 C:\xampp\Zend\library\Zend\Auth.php(117): Zend_Auth_Adapter_DbTable->authenticate()
#6 C:\xampp\htdocs\Eulen\application\controllers\AuthenticationController.php(27): Zend_Auth->authenticate(Object(Zend_Auth_Adapter_DbTable))
#7 C:\xampp\Zend\library\Zend\Controller\Action.php(516): AuthenticationController->logininAction()
#8 C:\xampp\Zend\library\Zend\Controller\Dispatcher\Standard.php(308): Zend_Controller_Action->dispatch('logininAction')
#9 C:\xampp\Zend\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#10 C:\xampp\Zend\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#11 C:\xampp\Zend\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#12 C:\xampp\htdocs\Eulen\public\index.php(26): Zend_Application->run()
#13 {main}  

Request Parameters:

array (
'controller' => 'authentication',
'action' => 'loginin',
'module' => 'default',
 )  

I was searching for a solution, and some of the possible errors were, spelling errors(I didn’t find any), can’t connect to phpmyadmin using my pass and user(if I go to the phpmyadmim site, I can enter using the username and password).

I have try several solution but I cant figure it out.

Am I missing something.

file config.ini:

 resources.db.params.charset = "utf8"
 resources.db.adapter = "pdo_mysql"
resources.db.params.host = localhost
resources.db.params.username = "onetag51_teste"
resources.db.params.password = "*******"
resources.db.params.dbname = "onetag51_eulenhugo"

Its better to put here the authenticationcontroller, maybe the problem is there..

 <?php

 class AuthenticationController extends Zend_Controller_Action
{

 public function init()
 {
    /* Initialize action controller here */
}

public function indexAction()
{
    // action body
}

public function logininAction()
{
    // action body
    $authAdapter =$this->getAuthAdapter();
    $username='hugo';
    $password='pass1';

    $authAdapter->setIdentity($username)
                ->setCredential($password);

    $auth =Zend_Auth::getInstance();
    $result = $auth->authenticate($authAdapter);
    if($result->isValid())
    {
        echo 'valid';
    }
    else
    {
        echo 'invalid';
    }
}

public function logoutAction()
{
    // action body
}
private function  getAuthAdapter()
{
    $authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter());
    $authAdapter->setTableName('users')
                ->setIdentityColumn('username')
                ->setCredentialColumn('password');

    return $authAdapter;
}              


}

ive been talking to a friend of mine, and he told me that i need to set the permission for acesse the phpmyadmim through zend…

How can i do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:24:54+00:00Added an answer on June 18, 2026 at 8:24 am

    You don’t need to use quotations around your adpater, username, password and dbname in your config file. I don’t in mine, hope this helps.

    I found a bit more reading that might be helpful access denied for user @ ‘localhost’ to database ” because it mentions

    You need grant privileges to the user if you want external acess to database(ie. web pages).
    in the answer.

    There is also this link about adding the users to the database in mysql.

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use the Zend Framework and I am having trouble figuring
I've been having problems created modular reusable components in my Zend Framework app. In
I'm having trouble finding my way around Zend Framework documentation. I'm currently using the
I'm building a website using Zend Framework and having trouble implementing modules and custom
Having trouble with this code, wondering if I'm trying to achieve something impossible. I'm
I am trying to learn Zend. I'm having trouble understanding the concept of MVC.
Having trouble when trying to create a class using another class(and 2 inner classes),
I'm having trouble determining the file-type of an image I uploaded with Zend Framework.
am having trouble with reporting errors in zend framework, errors messages are not displayed
I'm having trouble making a Union query using the Zend Framework. The queries are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.