0

I have 2 different MySQL databases, one created on a live server and another on a local XAMPP server. For some reasons, I can't access the databases on the live server (using phpMyAdmin) but I have access to the database files in var/mysql. So, I'm trying to recreate the databases on the local XAMPP server and access them with phpMyAdmin. I've tried 2 approaches.

  1. Copying the database file into the mySQL data directory of the local server. With this, I can see the database on phpMyAdmin, but there are no tables populated in it. I'm guessing that's because of metadata inconsistencies.

  2. Replacing the whole local mySQL data directory with the live mySQL data directory. But I'm getting connection problems.

    MySQL said: Documentation
    
    Cannot connect: invalid settings.
    mysqli::real_connect(): (HY000/2002): Permission denied
    
    Connection for controluser as defined in your configuration failed.
    
    mysqli::real_connect(): (HY000/2002): Permission denied
    
    phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
    

I've tried solutions like these, but I'm not still able to get access to the databases on phpMyAdmin.

Edit: I mean I don't have access to the databases either through phpyAdmin or command line mySQL. I just have access to the raw files.

4
  • 1
    youi can add a second config server stackoverflow.com/questions/16801573/…
    – nbk
    Aug 2, 2021 at 19:19
  • @nbk Does that work even if I don't have access to the live server? I just have the files for the database saved from a backup.
    – TheSoldier
    Aug 3, 2021 at 7:07
  • 1
    that works, when both are live, to play with a backup i recomend installing a VM or docker, and then read up how to restore backups. copying data works only if you have the same Version of mysql and you have to copy everything
    – nbk
    Aug 3, 2021 at 7:47
  • @nbk I used a VM and this procedures in this question stackoverflow.com/questions/484750/… and it worked. Thanks
    – TheSoldier
    Aug 3, 2021 at 12:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.