PermissionsEx MySQL "Unable to connect to SQL database..."

Discussion in 'Spigot Plugin Help' started by Xephos, Jun 4, 2017.

  1. Hi ! I have a problem with PermissionsEx (sql backend), and I don't found any solutions that work with me, so...
    I hope I can find the solution here.

    So, here is the error :

    I'm using XAMPP for access phpMyAdmin.

    Thanks in advance :x
    • Optimistic Optimistic x 1
  2. Your error:
    Based off all of the information you gave, I can tell you that PEX was unable to connect to the database. There isn't really much else you've given.

    Ensure the IP has access to the MySQL server (i.e. firewall might block the connection, or the bind-ip might be local), ensure the server is up, ensure the user's credentials are right, ensure the user has privileges on the database.
    • Funny Funny x 1
  3. From what I've could read is that pex was unable to connect with MySQL due to the bind-ip was perhaps on localhost or the port isn't forwarded
  4. I guess he's home hosting actually, so as long as he uses localhost he shouldn't need to port forward or change the bind IP.
    • Funny Funny x 1
  5. XAMPP/apachefriends is also useable in linux and mac though
  6. My Pex configuration :

    use-netevents: true
    debug: false
    allowOps: false
    user-add-groups-last: false
    log-players: false
    createUserRecords: false
    backend: sql
    changes: false
    basedir: plugins/PermissionsEx
    type: file
    file: permissions.yml
    type: sql
    uri: mysql://localhost/pex
    user: ***
    password: *********
    updater: true
    alwaysUpdate: false

    I don't really understand what I need to do and i'm such a noob with these things lmao
    • Useful Useful x 1
  7. Is mysql actually running :p?
    • Funny Funny x 1
  8. Yes sure :x
    • Winner Winner x 1
  9. Is the mysql running on the default port?
    • Creative Creative x 1
  10. No because I had already a program running with port 80
    • Funny Funny x 1
  11. Then set the port in the config like this:

    uri: mysql://localhost:pORTHERE/pex

    But i guess you talk about you apache, if i remember well the mysql running on different port. You can check in the mysql config.

    Edit: Ohh that smile... -.- uri: mysql://localhost : PORTHERE/pex without spaces :D
  12. Mysql normally run on port 3306 so why would you try to put it on port 80 which is standard port for http/webserver?

    But yes if you changed the standard port (away from 3306) of Mysql you would need to include it in your config.yml as stated above:

    Code (Text):

    uri: mysql://localhost:PORTHERE/pex
  13. Oh that was Apache that had port 80, and I switch it to 24
    • Funny Funny x 1
  14. May you should switch it back to 3306 as it will only give you a lot of problems with stuff expecting the mysql-server to be on standard port. The solutions mentioned above will however solve the problem if everything else is setup correctly.
  15. [​IMG]

    It looks like that in phpMyAdmin so.... idk
    • Funny Funny x 1
  16. My MySQL has already 3306 as port, so it's good, that's apache who has the port 24
    • Funny Funny x 1
  17. That seems to be your webserver running on port 24?
  18. Yes it is. So i don't need to specify the port in Pex config ?
    • Funny Funny x 1
  19. Any solutions ? :c
  20. electronicboy

    IRC Staff

    Code (Text):
    Caused by: Connection refused
    if you're running on windows, you might need to be weary of the windows firewall or the fact that windows in general sucks for the interop of components like mysql and other software (Hence why xampp was made for windows (and then seemingly ported for other platforms too for some reason...)), otherwise, modify the mysqld config and make sure that the bind address is uncommented and set to either, or