Results 1 to 30 of 30
  1. #1
    Join Date
    Nov 2013
    Posts
    182

    GameCP connection problems

    So installed GameCP. During installation, used localhost and a SQL user / database that I had setup. Now I've added a machine to game CP and and it asks me to copypasta a command into SSH.

    I get this back
    (ctrl+c to cancel)Access denied for user 'X_cpuser'@'localhost' (using password: YES)
    So tried putting the public IP of the machine instead of localhost or 127.0.0.1 but doesn't take it. I know the information is correct.

    If I use the root SQL username and password it accepts that, but then under GameCP I get a "unable to connect to the remote" error.

    Any ideas what I'm doing wrong? GameCP is installed on the machine so it and the remote should be using the same public IP.
    Last edited by A Goat; 12-10-2013 at 02:50 PM.

  2. #2
    Join Date
    Nov 2013
    Posts
    97
    Hi,

    did you created the permissions for the user X-cpuser into the database? Also you have to have the permissions set for the correct source ip or use '%' for any.

  3. #3
    Join Date
    Apr 2006
    Location
    Charleston, SC
    Posts
    176
    Best way to get help for this is to go over and talk to William on his IRC server, he can probably help you out.

  4. #4
    Join Date
    Nov 2013
    Posts
    182
    Quote Originally Posted by Natcoweb-Peter View Post
    Hi,

    did you created the permissions for the user X-cpuser into the database? Also you have to have the permissions set for the correct source ip or use '%' for any.
    The GameCP instructions aren't clear. I created the database and added the user with full permissions under MySQL Database Wizard in cPanel. I assume something different needs to be done in SSH but like I said it doesn't tell you where or how to setup this unlike TCAdmin.

  5. #5
    Join Date
    Nov 2013
    Posts
    97
    Try running the following command on mysql
    GRANT ALL ON database_name.* TO 'X_cpuser'@'your_app_ip' IDENTIFIED BY 'some_password';
    then
    FLUSH PRIVILEGES;

    and then try to connect to the mysql from your app host via console if possible.

  6. #6
    Join Date
    Nov 2013
    Posts
    182
    Still nope.
    Access denied for user 'firehost_userpg'@'server.mydomain.com' (using password: YES)
    Which is weird because I have the server IP set in GameCP Machine Management, GameCP Settings and gamecp.ini

  7. #7
    Join Date
    Nov 2013
    Posts
    97
    can you do cli access to your mysql server? Did you run the grant command? Have you used ip or domain name in that command?

  8. #8
    Join Date
    Nov 2013
    Posts
    182
    Okay so,

    Under GameCP Settings:
    Database Name: X_sqlcpg
    Remote IP: 1XX.XX.XXX.XXX
    Remote Password: XXXXXXXXXXX
    Database User: X_userpg

    Under GameCP Machine Management:
    Address: Same as above.

    From nano /usr/local/gcp/gamecp.ini
    mysql_host=1XX.XX.XXX.XXX
    mysql_user=X_userpg
    mysql_pass=XXXXXXXXXXX
    mysql_database=X_sqlcpg
    serverid=3
    passphrase=xxxxxxxxx
    debug=off
    listenport=240
    user_group=default

    So then did in SSH under root shell login:
    mysql
    GRANT ALL ON X_sqlcpg.* TO 'X_userpg'@'1XX.XX.XXX.XXX' IDENTIFIED BY 'XXXXXXXXXXX';
    FLUSH PRIVILEGES;
    exit

    Then I did:
    service gameCP restart

    Which gave me:
    Access denied for user 'X_userpg'@'server.mydomain.com' (using password: YES)
    Last edited by A Goat; 12-11-2013 at 06:48 AM.

  9. #9
    Join Date
    Nov 2013
    Posts
    97
    is the database on the same server as the application?

  10. #10
    Join Date
    Nov 2013
    Posts
    182
    yes it is indeed

  11. #11
    Join Date
    Nov 2013
    Posts
    97
    when you do GRANT ALL ON X_sqlcpg.* TO 'X_userpg'@'1XX.XX.XXX.XXX' IDENTIFIED BY 'XXXXXXXXXXX';
    FLUSH PRIVILEGES; the 1XX.XX.XXX.XXX has to be the client IP address.

  12. #12
    Join Date
    Nov 2013
    Posts
    182
    I don't understand.

  13. #13
    Join Date
    Nov 2013
    Posts
    97
    why don't you try connecting via localhost and modify the grant command to look like this:
    GRANT ALL ON X_sqlcpg.* TO 'X_userpg'@'127.0.0.1' IDENTIFIED BY 'XXXXXXXXXXX';
    and also change the GameCP database setting so that the ip look at 127.0.0.1

  14. #14
    Join Date
    Nov 2013
    Posts
    97
    Quote Originally Posted by freebudy View Post
    I don't understand.
    this would be in the case where the database would be a remote one which is not your case.

    for example you have a database on 10.0.0.XX and you are connecting from 10.0.0.yy then your grant command should look like this:
    GRANT ALL ON X_sqlcpg.* TO 'X_userpg'@'10.0.0.yy' IDENTIFIED BY 'XXXXXXXXXXX';

    that is because you have to give access to the client which does come from 10.0.0.yy ip.

  15. #15
    Join Date
    Nov 2013
    Posts
    97
    Also try connecting via ssh and run the following command:

    # mysql -u X_cpuser -h localhost -p'your_password' X_sqlcpg

    this is to see if you can connect to the database from the localhost using that user.

  16. #16
    Join Date
    Nov 2013
    Posts
    182
    Quote Originally Posted by Natcoweb-Peter View Post
    Also try connecting via ssh and run the following command:

    # mysql -u X_cpuser -h localhost -p'your_password' X_sqlcpg

    this is to see if you can connect to the database from the localhost using that user.
    Yep, that connects.

  17. #17
    Join Date
    Nov 2013
    Posts
    182
    Quote Originally Posted by Natcoweb-Peter View Post
    why don't you try connecting via localhost and modify the grant command to look like this:
    GRANT ALL ON X_sqlcpg.* TO 'X_userpg'@'127.0.0.1' IDENTIFIED BY 'XXXXXXXXXXX';
    and also change the GameCP database setting so that the ip look at 127.0.0.1
    Just tried that, no difference.

    The GameCP and Remote Server share the same exact IP and I can verify using the "# mysql -u X_cpuser -h localhost -p'your_password' X_sqlcpg" that there is no problems connecting.

    I'm starting to get fed up with this crap software.

  18. #18
    Join Date
    Nov 2013
    Posts
    97
    try this:
    Under GameCP Settings:
    Database Name: X_sqlcpg
    Remote IP: localhost
    Remote Password: XXXXXXXXXXX
    Database User: X_userpg

  19. #19
    Join Date
    Nov 2013
    Posts
    182
    Nope. Still doesn't work.

  20. #20
    Join Date
    Nov 2013
    Posts
    97
    Your problem is with the application because using that credentials and settings from CLI does work fine. You need to put your app on debug mode and analyse carefully your logs.

  21. #21
    Join Date
    Nov 2013
    Posts
    97
    you might want to try to take a network trace on the mysql connection and might be able to get what is wrong from there.

  22. #22
    Join Date
    Nov 2013
    Posts
    182
    That is way too complicated for me.

  23. #23
    Join Date
    Nov 2013
    Posts
    97
    Is it a vps or just a hosted app? Are you able to install software on it? I can give you the command.

  24. #24
    Join Date
    Nov 2013
    Posts
    182
    It's a full dedicated server! I have root and KVM over IP.

  25. #25
    Join Date
    Jun 2002
    Posts
    1,166
    Try creating the mysql user with the commands below and use the actual ip address in the ini file rather than localhost.

    CREATE USER '$user'@'%' IDENTIFIED BY '$pass';
    GRANT USAGE ON *.* TO '$user'@'%';
    GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON $db.* TO '$user'@'%';
    FLUSH PRIVILEGES;

  26. #26
    Join Date
    Nov 2013
    Posts
    182
    Quote Originally Posted by Xenos View Post
    Try creating the mysql user with the commands below and use the actual ip address in the ini file rather than localhost.

    CREATE USER '$user'@'%' IDENTIFIED BY '$pass';
    GRANT USAGE ON *.* TO '$user'@'%';
    GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON $db.* TO '$user'@'%';
    FLUSH PRIVILEGES;
    So like this?
    PHP Code:
    CREATE USER 'X_XX'@'%' IDENTIFIED BY 'X_XX';
    GRANT USAGE ON *.* TO 'X_XX'@'%';
    GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON $db.* TO '$X_XX'@'%';
    FLUSH PRIVILEGES

  27. #27
    Join Date
    Jun 2002
    Posts
    1,166
    Quote Originally Posted by freebudy View Post
    So like this?
    PHP Code:
    CREATE USER 'X_XX'@'%' IDENTIFIED BY 'X_XX';
    GRANT USAGE ON *.* TO 'X_XX'@'%';
    GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON $db.* TO '$X_XX'@'%';
    FLUSH PRIVILEGES
    Correct, I would also delete the user you have been experimenting with if you want to use the same user name. I ran into this same issue when setting up GameCP last year.

  28. #28
    Join Date
    Nov 2013
    Posts
    182
    So deleted the user under cPanel and ran that command but it hasn't done anything?

  29. #29
    Join Date
    Nov 2013
    Posts
    182
    mysql> CREATE USER 'X_X'@'%' IDENTIFIED BY 'XXXXXXXX';
    Query OK, 0 rows affected (0.00 sec)

    mysql> GRANT USAGE ON *.* TO 'X_X'@'%';
    Query OK, 0 rows affected (0.00 sec)

    mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON $db.* TO 'X_X'@'%';
    Query OK, 0 rows affected (0.00 sec)

    mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.00 sec)
    Here was the CL response.

  30. #30
    Join Date
    Nov 2013
    Posts
    97
    That is useless since he does not have permission problem. The database connections works just fine from the CLI directly. His app is sending some extra characters in the mysql syntax and that is why is not working.
    I suggest installing tcpdump and take a trace using the following command

    Code:
    #tcpdump -i any -s0 -w /var/tmp/mysql.pcap -vvv port 3066
    try to run the application until you get the error with permission deny.
    download the file to your computer and analyse it with wireshark.

Similar Threads

  1. PC-TV Connection Problems
    By JDrago1926 in forum Computers and Peripherals
    Replies: 2
    Last Post: 08-21-2009, 01:20 AM
  2. UK - US connection problems?
    By Liam - OxyUK in forum Providers and Network Outages and Updates
    Replies: 10
    Last Post: 07-21-2006, 04:12 PM
  3. what possible explanations for connection problems
    By chuckt101 in forum Hosting Security and Technology
    Replies: 1
    Last Post: 01-08-2005, 11:46 PM
  4. connection problems
    By Aron in forum Hosting Security and Technology
    Replies: 2
    Last Post: 12-18-2002, 08:46 AM
  5. User Connection Problems
    By David_Kiofly in forum Reseller Hosting
    Replies: 0
    Last Post: 03-15-2002, 10:28 AM

Posting Permissions

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