EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=617)
-   -   Mysql/DB question (https://www.eqemulator.org/forums/showthread.php?t=8290)

Spedfist 06-23-2003 01:31 PM

Mysql/DB question
 
how would i go about clearing a table so i can source information from a sql formatted text file just for that table, for example: i want to source info from city_defense.txt, but i need to clear the info thats already in the table first so i dont get duplicate errors

burthold 06-23-2003 01:35 PM

truncate table <table name>

Memener 06-23-2003 01:36 PM

if you get duplicate errors it means it is already sourced into your database if you get a mismatch error then you have problems

Spedfist 06-23-2003 01:36 PM

re
 
woot thanks a bunch!

Spedfist 06-23-2003 01:42 PM

re
 
i was resourcing with a newer version of the table is what i was doing, so wanted to know just how to drop individual table, but......another question...how do i clear the whole database

Memener 06-23-2003 01:44 PM

to delete the whole Database open mysql and type drop database eq; then hit enter but if you want to back up the chars or item i dont know those commands

Velosity 06-23-2003 06:25 PM

if you wish to drop a table just go into mysql and type this

Code:

MySql> use databasename;
Database Changed
MySql> drop table tablename;
Query OK, Yadda Yadda

If you wish to back up your database open up your command prompt (open start menue, go to run, open cmd) or open your MS-DOS prompt

then type this in

[Prompt]
C:\>cd c:\mysql\bin
C:\Mysql\Bin\> mysqldump databasename > filename.sql
[/Prompt]

That will put your database in a sql file

If you want just a specific table from your database dumped so you can do a drop table command type this

[Prompt]
C:\>cd c:\mysql\bin
C:\Mysql\Bin\> mysqldump databasename tablename > filename.sql
[/Prompt]

Hope that helps

Spedfist 06-24-2003 12:46 PM

re
 
how would i go about only backing up the character saves that are in the db? and then how to restore those?

thanks for all of the help btw =)

Lurker_005 06-24-2003 01:20 PM

Quote:

Originally Posted by burthold
truncate table <table name>

Ahh I was looking for the command that behaved that way last week :p

Specifically a way to get the autoassigned ID's to start at the beginning again (doors table). I ended dropping the table and recreating it manually :p Much easier! Thanks

burthold 06-24-2003 01:38 PM

the truncate will restart the incramenting key.

Wes


All times are GMT -4. The time now is 12:14 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.