vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   database delete / database import (https://vborg.vbsupport.ru/showthread.php?t=35367)

wooolF[RM] 02-23-2002 08:35 PM

]Hi, I have a database (old one) that I want to drop from MySQl server with this php file :

PHP Code:

<?
system ("mysql -h hosthere -u loginhere --password=passhere -e "drop database databasenamehere"; phpinfo();
?>

^^^doesn't work... anyone got any idea?

after that I need to import a backed up database to this place with this php file :

PHP Code:

<?
system ("mysql -h hosthere -u loginhere --password=passhere databasenamehere < dump.sql");
phpinfo();
?>

^^ works just fine...


Can anybody can me with script that drop the whole database at once? Thanx

wooolF[RM] 02-23-2002 09:08 PM

]very helpfull community... :D

I found a script...

PHP Code:

<?
mysql_connect("hostname","username","password");
$query = "DROP DATABASE databasenamehere";
$result = mysql_query($query);
phpinfo();
?>

but now damn import script doesn't work... darn! :/

wooolF[RM] 02-24-2002 02:43 PM

]still noone? :D

I need import script that works......

Admin 02-24-2002 02:46 PM

Have you tried creating the database first, before importing into it?

wooolF[RM] 02-24-2002 04:08 PM

well... that's actually the problem...
as U have seen from delete script, I have just dropped database...

Now I can't import any data as database doesn't exist... And I really don't know how to create one. I know it's easy for all of u to say go to google or MySQL hp and look there. But I think for some of u are much more easier to give 3-4 lines script.

Please help. Thanx

Admin 02-24-2002 04:15 PM

Code:

mysql_query("CREATE DATABASE databasename");

wooolF[RM] 02-24-2002 04:18 PM

]so something like:

PHP Code:

<?
mysql_connect("hostname","username","password");
mysql_query("CREATE DATABASE databasename");
$result = mysql_query($query);
phpinfo();
?>

and then I should run this script :
PHP Code:

<?
system ("mysql -h hosthere -u loginhere --password=passhere databasenamehere < dump.sql");
phpinfo();
?>

and I'm done? :supwink:

Admin 02-24-2002 04:23 PM

Remove
Code:

$result = mysql_query($query);
phpinfo();

from the first code, and remove the call to phpinfo() from the second.

wooolF[RM] 02-24-2002 04:29 PM

]who's your daddy?! FireFly is! LOL :D

Thanx a lot! Everything works! GJ!

Admin 02-24-2002 04:35 PM

I have a son?

wooolF[RM] 02-24-2002 04:38 PM

]:D :D :D :D :D :D :D

^^^^ OFFTOPIC ^^^^

;)

Stretchr 03-03-2002 03:22 PM

I really need this script but the import portion of the script is not importing the sql dump file. Here's what I used:
PHP Code:

<?
mysql_connect("localhost","dbusername","dbpassword");
mysql_query("CREATE DATABASE dbname");
system ("mysql -h localhost -u dbusername --password=dbpassword dbname < webdjnet.sql");
?>

I ran the drop script first, then this one. The database is created but nothing imports. I would really appreciate any help. Thanks!

:confused:

Courage 06-22-2002 10:04 PM

I Also have this problem... i have a 85 Mb sql file on my ftp and no wey to import it :@

Plase help !!!!!


All times are GMT. The time now is 07:26 PM.

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.01422 seconds
  • Memory Usage 1,735KB
  • 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
  • (6)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)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