3

I'm using Yii 2.0 basic template. I have tried to connect to the DB. The connection in local db is working. But I'm not able to connect to the remote mySQL db that is in domain server.

This is my db config:

return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=smargav.com;dbname=smargavc_Konnections',
    'username' => 'smargavc_Konnect',
    'password' => '******',
    'charset' => 'utf8'
];

I'm getting error as following:

{"name":"Database Exception","message":"SQLSTATE[HY000] [1045] Access denied for user 'smargavc_Konnect'@'122.167.47.26' (using password:

1 Answer 1

1

connection string seems fine

Several possible causes :

  1. smargavc_Konnect user doesn't have permission to connect remotely
  2. MYSQL is in stopped state at remote server
  3. 3306 port is not allowed in remote server
  4. Your IP is not allowed to access the remote server using http

Check if all of these are true , you should be able to connect

Sign up to request clarification or add additional context in comments.

4 Comments

How can i figure out these problems?
try connecting using any mysql client using mysql workbench , If you are : that means all these 4 problems have fixed.
For problem 1 : login to mysql using root check user table and it's access for Problem 2: login to server start mysql by sudo service mysqld start For problem 3: check if port 3306 is allowed in security group
This time, i uploaded yii framework into server. now im getting 500 error. Please check stackoverflow.com/questions/30340469/…

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.