CI 묻고 답하기

제목 DB 커넥터 질문입니다.
글쓴이 제스퍼 작성시각 2013/08/15 17:12:17
댓글 : 4 추천 : 0 스크랩 : 0 조회수 : 17388   RSS

A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: C:\xampp\htdocs\regPronDic\system\database\DB_driver.php

Line Number: 124


다음과 같이 나옵니다.

db설정은 아래와 같구요..


$db['default']['hostname'] = '{hostname};
$db['default']['username'] = '{username}';
$db['default']['password'] = '{password}';
$db['default']['database'] = 'regPronDic';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

같은 파일로 서버에 올라가 있는건 정상 작동하는데

로컬에서 작업할떄만 저런 증상이 나타납니다.

정리하면

svn으로 같은 파일을 서버에 올려놨을떄는 정상동작

로컬에서는 디비접속 에러

서버에서 localhost로 접속한것도 아니고

로컬과 똑같이 해당 아이피 xxx.xxx.xxx.xxx 형식으로 hostname을 지정했는데도

마찬가지로 에러가 뜹니다..

뭐가 다른가..고민을 해본 결과..

일단 OS가 서버는 centos, 클라이언트는 win7

APM은 서버는 yum으로 받은 각각 php, mysql, apache.

클라이언트는 xampp..

이정도 다른데.. 뭐가 문제일까요?

뭘 확인해봐야할까요..흑..
 다음글 insert() 관련 문의드립니다. (4)
 이전글 ci 초짜입니다. 쿼리 로그 (2)

댓글

변종원(웅파) / 2013/08/15 19:06:49 / 추천 0
로컬에서 mysql_connect로 연결테스트 해보세요. mysql host가 특정 아이피로 되어있을 수도 있습니다.(서버 아이피)
제스퍼 / 2013/08/15 21:14:24 / 추천 0
웅파// 답변감사합니다 웅파님!~!
말씀해주신데로
index,php에다가 아래와 같이 접속 테스트를 했더니 이렇게 나왔습니다.

$link=mysql_connect("xxx.xxx.xxx.xxx","root","1234");
if(!$link) {
 die('Failed Connect MySql : '.mysql_error());
 } else {
 echo "Successed Connect MySql<br>";
 }

===============================================


Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in C:\xampp\htdocs\regPronDic\index.php on line 4
Could not connect: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file
변종원(웅파) / 2013/08/15 23:17:22 / 추천 0
mysql이 오래된 버전이라 패스워드 체계가 달라서 접속이 안되는거였네요.

서버의 mysql 버전이 꽤 낮나봅니다.

로컬에서는 메세지처럼 패스워드를 업데이트해서 사용해야합니다.
제스퍼 / 2013/08/17 14:16:25 / 추천 0
 감사합니다 웅파님 :)