[Multiserver]#1698 - Access denied for user 'root'@'localhost'

Discussion in 'Installation/Configuration' started by Tuumke, Jun 3, 2017.

  1. Tuumke

    Tuumke Member

    Hey guys,

    I have a clean install of ISPConfig on 5 servers (web, sql, mail, ns1, ns2).
    When i go to the webserver and do /phpmyadmin and try to login as root, i get the topic mentioned error.

    #1698 - Access denied for user 'root'@'localhost'
     
    Last edited: Jun 3, 2017
  2. ahrasis

    ahrasis Active Member

    Try to reconfigure phpmyadmin and/or reset your mysql password.
     
  3. Tuumke

    Tuumke Member

    Well, when using mysql -u root -h web.example.tld -p
    I can login with root password... It's just that i cant do it from phpmyadmin... Followed the perfect guide + multi server setup, but no luck :(
     
  4. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    double-check that you use the password for the web-server. Did you run mysql -u root -h web.example.tld -p on web or a different server?
     
  5. Tuumke

    Tuumke Member

    Yes that works fine.
    But wait a minute, i have my DB @ sql.example.tld, but phpmyadmin probably connects to its localhost? on the web.example.tld?
     
  6. Tuumke

    Tuumke Member

    Ah,
    Had to create a root user on the SQL host for the web.example.tld (and ip adress). And edit the /etc/phpmyadmin/config-db.php to go to the sql server (this is not in the manuals!)
     
  7. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    phpmyadmin is an interface for sql-connections. per default the connects are made to local-db. if you need remote-connections, you have to change the phpmyadmin-config. I don't think, that this is an requirement for the tutorials. As long as you do not run a dedicated db-server, the databases are always stored on the web-server so webserver/phpmyadmin works. You can also define more servers for phpmyadmin and choose the right server from a drop-down.
     
  8. Tuumke

    Tuumke Member

    I meant the payed manual (Version 3.1) where you setup 5 servers.
     
  9. Tuumke

    Tuumke Member

    I dont know if i should create a 2nd topic for this but:
    When you create a DB user in ISPConfig, it gets created on the DB server.
    Though, not with hostname -f from the ISPConfig panel. Only localhost and ip address.
     
  10. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Enable "remote access" for the database.
     
  11. Tuumke

    Tuumke Member

    Hm, security wise not really an option. Do you know which file does this? Where i could add manually to make it create the web.example.tld user as well?
     
  12. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    You can already limit the db-access for certain ips.
     
  13. Chris_UK

    Chris_UK New Member HowtoForge Supporter

    I believe information for how to setup phpmyadmin (within ispconfig ofcourse) with remote database should be included within the multiserver instructions, I know it is not technically an ispconfig issue but if its managing the server then it should probably come with some basic setup guidelines/recommendations even if it does not complete the changes itself.
     
  14. Taleman

    Taleman Member

    I do not understand what is the problem. I have databases on the web server and databases on the dedicated database host. I use phpmyadmin on the host where the database is, and have not needed to set up any extra database users or any other extra stuff.
     
  15. Chris_UK

    Chris_UK New Member HowtoForge Supporter

    Okay here is how this works.
    web holds your website and phpmyadmin
    sql holds the database information.

    Phpmyadmin by default only works on a local database. (a database that would be on "web")
    As this is not the case phpmyadmin cannot access the information because its not useing the correct information to log into the remote sql server.

    You dont yourself setup the database on the remote server, this is done for you during installation but the multiserver installation does not tell phpmyadmin where the server is located, only installing the default config that comes with phpmyadmin.

    To remedy this you will need to edid the phpmyadmin configuration settings (within the files) and update the server, possibly the user and password too.

    SSH into the web server (where phpmyadmin is located)
    run the commands: use sudo if needed.
    whereis phpmyadmin this should return two paths, under /etc and under /usr
    cd /etc/phpmyadmin (or whatever your path is)
    ls You are just checking fro config.inc.php if its there you have the right path
    cp config.inc.php config.inc.php.bak always backup the file.
    nano config.inc.php In this file when you read through you will find the section with the database settings. they will say localhost for the server, make changes to match your configuration.
    ctrl + x
    answer yes
    enter


    You should be out of nano and back at the command prompt. You can now test your phpmyadmin and see if you are able to log in
     
    Last edited: Jun 28, 2017

Share This Page