내 컴퓨터에서 실행중인 Wordpress를 내 컴퓨터 (localhost)에서 터널링되는 원격 mysql 데이터베이스에 연결하려고합니다. 워드 프레스의 wp-config.php
파일에서 mysql
CLI 클라이언트강제로 워드 프로세서가 TCP를 통해 데이터베이스에 연결
$ mysql --protocol=TCP -P 10000 -h localhost -u username -p'password' db_name
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 93438893
Server version: 5.5.8-log Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+-----------------------------------+
| Database |
+-----------------------------------+
| information_schema |
| db_name |
+-----------------------------------+
2 rows in set (1.38 sec)
에 다음과 같은 매개 변수를 제공하여 데이터베이스 연결 작업, 나는 다음과 같은 값을 시도 :
define('DB_NAME', 'db_name');
define('DB_USER', 'username');
define('DB_PASSWORD', 'password');
define('DB_HOST', 'localhost');
define('DB_PORT', 10000);
이 &를 작동하지 않는 다음과 같은 오류가 발생합니다 :
Warning: include(/home/gaurish/Dropbox/code/projects/blog/wp-content/advanced-cache.php): failed to open stream: No such file or directory in /home/gaurish/Dropbox/code/projects/blog/wp-settings.php on line 62
Warning: include(): Failed opening '/home/gaurish/Dropbox/code/projects/blog/wp-content/advanced-cache.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/gaurish/Dropbox/code/projects/blog/wp-settings.php on line 62
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/gaurish/Dropbox/code/projects/blog/wp-includes/wp-db.php on line 1038
상기 에러의 마지막 라인 (Can't connect to local MySQL server through socket
)는 왜 t를 범 그는 WordPress가 유닉스 소켓을 통해 연결하려고 할 때 연결이 실패합니다.
이제는 데이터베이스에 연결할 수 있도록하기 위해 어떤 매개 변수를 설정해야합니까? mysql
CLI 클라이언트?
이 을 시도했다 그러나 그것은 너무 오류 발생 : '경고 :로 mysql_connect()를'127.0.0.1 '(111)에서 MySQL 서버에 연결할 수 없습니다 /home/gaurish/Dropbox/code/projects/blog/wp-includes/wp-db.php on line 1038' 더 많은 아이디어가 있습니까? – CuriousMind
오류 111은 액세스가 거부되었음을 의미합니다. TCP를 통해 연결하도록 허용 된 사용자를 추가 했습니까? – drew010
http://stackoverflow.com/questions/1420839/cant-connect-to-mysql-server-error-111 – drew010