我已经查看了所有相关的问题和答案,但仍然无法连接到远程 mysql 数据库。
到目前为止我所做的是..
1
CREATE USER 'root'@'192.168.1.100' IDENTIFIED BY '***';
GRANT ALL PRIVILEGES ON * . * TO 'root'@'192.168.1.100' IDENTIFIED BY '***' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
2
my.cnf file in server (which is in /etc/my.cnf path let me if it is not correct)
[mysqld]
innodb_file_per_table=1
#bind-address = 127.0.0.1
#skip-networking
以下是我项目的 database.yml。
all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: mysql:host=[ip of remote server];dbname=dev_db
username: user
password: user12
encoding: utf8
attributes:
use_native_enum: true
default_table_type: INNODB
default_table_collate: utf8_unicode_ci
default_table_charset: utf8
我收到以下异常
PDO Connection Error: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '50.115.116.203' (4)
那么配置远程数据库还缺少什么。
请帮忙
谢谢你。