[TYPO3-english] transfer typo3 database

Krystian Szymukowicz t33k at prolabium.com
Tue Jun 14 11:46:07 CEST 2011


W dniu 2011-06-14 11:16, tom liu wrote:
> Hi,
>
> I am transferring typo3 to the other site. When i import the typo3 database
> to the other site through phpmyadmin, it shows the sql file(11MB) too large,
> can not be imported, how could i do? thanks.
>
> Blessings--Tom


hi


Using phpmyadmin is not good as Christian suggest.


Instead put your database in some subfolder like "_import" and name it 
"database.sql"

Then put this script as php file "import_database.php" in this folder 
and run from your browser like 
http://www.example.com/_import/import_database.php


<?php

$path_to_mysql = '/usr/local/bin/';
require('../typo3conf/localconf.php');

$conn = mysql_connect($typo_db_host,$typo_db_username,$typo_db_password);
if (!$conn) {
	die('No DB conn: ' . mysql_error());
}

mysql_select_db($typo_db);
exec("${path_to_mysql}mysql  -u$typo_db_username -p$typo_db_password -D 
$typo_db -e \"SOURCE ./database.sql\"");



Note!!!
It will overwrite your existing database as it is taking data from 
'../typo3conf/localconf.php'  - so be careful.

You may need to change the path to $path_to_mysql = '/usr/local/bin/';



-- 
grtz
Krystian Szymukowicz


More information about the TYPO3-english mailing list