The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Remote MySql problem

Discussion in 'Database Discussions' started by mahdimahdi, Apr 29, 2011.

  1. mahdimahdi

    mahdimahdi Member

    Joined:
    Apr 29, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi everybody
    I have an application that wants to connect to mysql database on server.
    I already add my computer IP to remote mysql section in cpanel.
    But the app can not connect to database.
    also, my connection string is:
    "Server=somesite.net; database='somesite_test';User Name='somesite_test'; Password='somesite_test' ;Port=3306; charset=utf8"
    What's the problem?
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Did you add the MySQL user to the MySQL database for access? Creating the user in cPanel > MySQL Databases area does not automatically add the user to the database. That step is another additional one that is needed.

    Next, are you certain you are using the right password for that MySQL user to connect to the database?
     
  3. mahdimahdi

    mahdimahdi Member

    Joined:
    Apr 29, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Yes. I did both of them carefully, but it didn't work. Is my connection string right?
     
  4. SamWin

    SamWin Registered

    Joined:
    Apr 30, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    if the connection string is wrong or you have used wrong login credentials then you must receive an error message accordingly.
    Can you please let us the exact error you are getting ?
     
  5. aapkapratik

    aapkapratik Member

    Joined:
    Oct 26, 2009
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    In my opinion the problem might be because of the two reasons

    1. As described by cPanelTristan and SamWin the connection string you are using or the login credentials you are using needs to be verified again..

    To remove the doubt here, I'd request you to login to your server using SSH as root and run the following commands

    Description of command is

    mysql>grant all privileges on database_name.* to user_name@localhost identified by 'password';

    Still if you are not able to connect to the mysql database on the server remotely..

    2. Please check if the firewall on your server is blocking the connection.. To test you may try connecting after disabling the firewall on the server or check if the local machine IP address is blocked on the server firewall..
     
  6. mahdimahdi

    mahdimahdi Member

    Joined:
    Apr 29, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for your reply.
    I use visual studio.net 2010 and MySql connector net. when I run my application the following error arises:

    http://fileofme.com/show.php/1256_error.jpg.html

    and I checked my user and password.
     
  7. mahdimahdi

    mahdimahdi Member

    Joined:
    Apr 29, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Thank you for your reply.
    I checked my credentials and those were correct.
    1. How can I use SSH.

    2. How can I check firewall on server. I only have an account of cpanel in somesite:2082 and when I login into it, I can not find an option for firewall.
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Do you only have a cPanel account? If you do not have WHM or root SSH access, then you would need to contact your hosting provider to have them assist with this issue. If you cannot log into the machine as the root user, then your access level would not be high enough to check the firewall on the machine.
     
  9. mahdimahdi

    mahdimahdi Member

    Joined:
    Apr 29, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Yes I only have a cPanel account.
    Thank you for your helps, I'll contact with them.
     
Loading...

Share This Page