vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Exporting/Importing table from MySQL with help of PHP files. (https://vborg.vbsupport.ru/showthread.php?t=36244)

wooolF[RM] 03-17-2002 01:47 PM

Exporting/Importing table from MySQL with help of PHP files.
 
]Hello all :)

Well... First want to say many thanx to FireFly for all help he have provided and for all his answers :)

I got a lil problem here. I must export table "templates" from MySQL database on the server where I have not installed myadmin yet and I don't have telnet access to it. So I must use PHP files to connect to the database and dump only one table from there (I'll download it after from FTP).

After that I must import it in another database. Just override old table. I don't know if I need to drop it first or I can just override it. I can use telnet/ftp/myadmin there with that MySQL database. So I will be very appreciated if u could paste the string I have to run to get that dumped table imported.

As u see I need to export a table with help of PHP file and then import that dumped table with help of telnet/myadmin/PHP file.

Please help if u can.

Thanx very much :)

wooolF[RM] 03-17-2002 02:06 PM

]
Code:

<?
mysql_connect("host","login","pass");
$query = "DUMP TABLE template FROM DATABASE databasenamehere";
$result = mysql_query($query);
?>

??? like that ???

wooolF[RM] 03-17-2002 03:38 PM

wroooooooooooom

wooolF[RM] 03-18-2002 11:40 AM

]really no one? :(

wooolF[RM] 03-19-2002 08:52 AM

]can something like this do the job:

Code:

<?
system ("mysqldump -u from_username_from -pfrom_password -h from_host
    from_db from_table | mysql -u to_user -pto_pass -h to_host to_db_name");
?>

Meaning of it is if I wish to copy the table to a completely different server.

nsr81 03-19-2002 10:31 AM

Hi there Woolf,

If it is a one time thing then I'd use phpMyAdmin to dump the table/db and get an sql script which you can run on your second server. If not, may be some one else can offer an opinion :)

wooolF[RM] 03-19-2002 10:38 AM

]well.. I have dumped table allready from one server... now I just need to be sure that commands I gave before are right ones :)

wooolF[RM] 03-19-2002 01:22 PM

thanx for help support... sorted it out myself...


All times are GMT. The time now is 12:31 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01018 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete