디비이전 방법... 정보
디비이전 방법...본문
호스팅회사를 옮기고 있습니다.
db를 백업받아 backup.sql 파일로 보관하고 있는데
이걸 옮겨가는 호스팅에 phpmyadmin에 접속하여 임포트 할려고 하니..
용량이 커서 업로드가 안되네요 ㅠㅠ
참고로 백업받은 파일용량이 200메가..phpmyadmin 업로드 용량은 8메가.
그래서 ssh로 접속하여 하려 했더니 ssh 접속지원을 안해주네요..ㅠㅠ
php를 이용하여서 저파일을 db에 입력할수 있다고 하던데...
방법좀 알려주세요..ㅠ
db를 백업받아 backup.sql 파일로 보관하고 있는데
이걸 옮겨가는 호스팅에 phpmyadmin에 접속하여 임포트 할려고 하니..
용량이 커서 업로드가 안되네요 ㅠㅠ
참고로 백업받은 파일용량이 200메가..phpmyadmin 업로드 용량은 8메가.
그래서 ssh로 접속하여 하려 했더니 ssh 접속지원을 안해주네요..ㅠㅠ
php를 이용하여서 저파일을 db에 입력할수 있다고 하던데...
방법좀 알려주세요..ㅠ
댓글 전체
나눠서 아니면 서버에서 실행시키게해영 ㅋㅋ
유료 호스팅이면 일반적으로 SSH 지원될텐데요.
돌려 보진 않았습니다.
sql 파일과 db_import.php를 같은 폴더에 넣고 웹에서 db_import.php를 여시면 되겠습니다.
db_import.php
<?
$mysql_host = 'localhost';
$mysql_user = '아이디';
$mysql_password = '비밀번호';
$mysql_db = '디비명';
$sql_file = "파일명";
$handle = fopen($sql_file, "r");
$contents = fread($handle, filesize($sql_file));
fclose($handle);
$connect_db = mysql_connect($mysql_host, $mysql_user, $mysql_password) or die("<meta http-equiv='content-type' content='text/html; charset=utf-8'><script type='text/javascript'> alert('DB Connection error.'); </script>");
$select_db = mysql_select_db($mysql_db, $connect_db) or die("<meta http-equiv='content-type' content='text/html; charset=utf-8'><script type='text/javascript'> alert('DB Selection error.'); </script>");
mysql_query($contents) or die(mysql_errno().":". mysql_error()."<p>error file : $_SERVER[PHP_SELF]");
mysql_close($connect_db);
?>
sql 파일과 db_import.php를 같은 폴더에 넣고 웹에서 db_import.php를 여시면 되겠습니다.
db_import.php
<?
$mysql_host = 'localhost';
$mysql_user = '아이디';
$mysql_password = '비밀번호';
$mysql_db = '디비명';
$sql_file = "파일명";
$handle = fopen($sql_file, "r");
$contents = fread($handle, filesize($sql_file));
fclose($handle);
$connect_db = mysql_connect($mysql_host, $mysql_user, $mysql_password) or die("<meta http-equiv='content-type' content='text/html; charset=utf-8'><script type='text/javascript'> alert('DB Connection error.'); </script>");
$select_db = mysql_select_db($mysql_db, $connect_db) or die("<meta http-equiv='content-type' content='text/html; charset=utf-8'><script type='text/javascript'> alert('DB Selection error.'); </script>");
mysql_query($contents) or die(mysql_errno().":". mysql_error()."<p>error file : $_SERVER[PHP_SELF]");
mysql_close($connect_db);
?>