Results 1 to 10 of 10

Thread: Cannot connect with da_admin

  1. #1
    Join Date
    Jun 2019
    Posts
    5

    Cannot connect with da_admin

    Hi Guys,

    When I want to create a back-up I get this error:
    Error connecting to MySQL: Access denied for user 'da_admin'@'localhost' (using password: YES)
    <b>Repair guide: <a target=_blank href='http://help.directadmin.com/item.php?id=45'>http://help.directadmin.com/item.php?id=45</a></b>


    If I follow the tutorial then I execute this commando's:
    Code:
    systemctl stop mysqld
    systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
    systemctl start mysqld
    
    mysql mysql -e "UPDATE mysql.user SET authentication_string=PASSWORD('****') WHERE user='root'; FLUSH PRIVILEGES;"
    
    systemctl unset-environment MYSQLD_OPTS
    systemctl stop mysqld
    systemctl start mysqld
    mysql -uroot -p'*****' -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '*****';"
    Then I get this error:
    Code:
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    Maybe it has something to do with this tutorial I followed:
    https://help.directadmin.com/item.php?id=140

    And executed this command exactly like this:
    Code:
    mysql -uda_admin -p --host=4.3.2.1
    Mysql is running fine. Firewall is not running.

    And when I edit:
    /var/www/html/phpMyAdmin/config.inc.php

    $cfg['Servers'][$i]['host'] = remote_server_address

    I still can't connect..

    Can you guys please help me out?

  2. #2
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    13,311
    Hello,

    At least 2 things might be wrong here:

    1. The command which you start with mysql mysql -e should have only 1 mysql mention:

    Code:
    mysql -e

    2. The part --host=4.3.2.1 should be used only if you host MySQL/MariaDB server outside of your DirectAdmin server. If you use the locally install SQL server, then the part should be omitted. If you really use a remote server, then 4.3.2.1 should be replaced by a real IP address of your SQL server.
    Regards, Alex G.

    - Get the best commercial DirectAdmin support and hire me on poralix.com
    - Follow and like @Poralix on Facebook

  3. #3
    Join Date
    Jun 2019
    Posts
    5
    Hi,

    Thanks for your quick response.
    I just want to connect to da_admin from a remote connection.

    When I execute this commando's I still get the same error:
    Code:
    systemctl stop mysqld
    systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
    systemctl start mysqld
    
    mysql -e "UPDATE mysql.user SET authentication_string=PASSWORD('****') WHERE user='root'; FLUSH PRIVILEGES;"
    
    systemctl unset-environment MYSQLD_OPTS
    systemctl stop mysqld
    systemctl start mysqld
    mysql -uroot -p'*****' -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '*****';"
    This is the error:
    Code:
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

  4. #4
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    13,311
    The commands you provided won't grant you an access to MySQL from a remote host.


    See https://help.directadmin.com/item.php?id=308
    Regards, Alex G.

    - Get the best commercial DirectAdmin support and hire me on poralix.com
    - Follow and like @Poralix on Facebook

  5. #5
    Join Date
    Jun 2019
    Posts
    5
    I know how to give access to a database from a user.
    But I want to connect with da_admin to see all the databases.

    I thinks it has something to do with this error I keep getting in directadmin:
    An error occurred during the backup:

    RoundCube Backup Error:
    Warning: mysqli::mysqli(): (HY000/1045): Access denied for user 'da_admin'@'localhost' (using password: YES) in /usr/local/directadmin/scripts/backup_roundcube.php on line 114
    Failed to connect to MySQL: (1045) Access denied for user 'da_admin'@'localhost' (using password: YES)


    Error connecting to MySQL: Access denied for user 'da_admin'@'localhost' (using password: YES)
    <b>Repair guide: <a target=_blank href='http://help.directadmin.com/item.php?id=45'>http://help.directadmin.com/item.php?id=45</a></b>

  6. #6
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    13,311
    The MySQL user da_admin is still an user even with more privileges, and hence you need to update allowed host for the user. By default user da_admin can be connected only from localhost.

    The guide http://help.directadmin.com/item.php?id=45 is not applicable here, and you should remove changes from /usr/local/directadmin/conf/mysql.conf and /usr/local/directadmin/conf/my.conf done per instructions in https://help.directadmin.com/item.php?id=140

    Connect to phpMyAdmin and update list of allowed hosts for user da_admin. Refer to official documentation for details.

    Make sure MySQL is bind to 0.0.0.0:3306 and firewall does not block connections.
    Regards, Alex G.

    - Get the best commercial DirectAdmin support and hire me on poralix.com
    - Follow and like @Poralix on Facebook

  7. #7
    Join Date
    Jun 2019
    Posts
    5
    Thanks for your response, I cannot undo the changes or don't know how to.

    I removed everything from these two files (only user=da_admin and the password are in the file now):
    /usr/local/directadmin/conf/my.cnf
    /usr/local/directadmin/conf/mysql.conf

    If I run this commando for example:
    Code:
    mysql -uroot -p
    I get this error:
    Code:
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    So I cannot execute this command to reset everything:
    Code:
    GRANT ALL PRIVILEGES ON *.* TO da_admin@0.0.0.0 WITH GRANT OPTION;
    FLUSH PRIVILEGES;

  8. #8
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    13,311
    You try to connect as root, but you recover a password for another user da_admin.

    A root's password to connect to MySQL can be found in /usr/local/directadmin/scripts/setup.txt, it is a line starting with mysql=
    Regards, Alex G.

    - Get the best commercial DirectAdmin support and hire me on poralix.com
    - Follow and like @Poralix on Facebook

  9. #9
    Join Date
    Jun 2019
    Posts
    5
    I found the password located in the: /usr/local/directadmin/scripts/setup.txt file

    But when I type:
    Code:
    mysql -uroot -p
    And use the password from the file I still get the error:
    Code:
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

  10. #10
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    13,311
    I believe you have all the needed instructions on how to recover a password to MySQL. If you can't manage to get it working you might need to get someone to fix it for you. You might contact either DirectAdmin support via tickets to get it resolved or me for a commercial support.
    Regards, Alex G.

    - Get the best commercial DirectAdmin support and hire me on poralix.com
    - Follow and like @Poralix on Facebook

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •