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
|
truncate table <table name>
|
if you get duplicate errors it means it is already sourced into your database if you get a mismatch error then you have problems
|
re
woot thanks a bunch!
|
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
|
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
|
if you wish to drop a table just go into mysql and type this
Code:
MySql> use databasename; 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 |
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 =) |
Quote:
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 |
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.