Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::General > Archive::General Discussion

Archive::General Discussion Archive area for General Discussion's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 12-13-2003, 05:10 AM
vbemos
Fire Beetle
 
Join Date: Oct 2003
Location: Worcester, UK
Posts: 16
Default

I think the best way to view the database is in mySQL, these are the basics, make sure you back your database up before you start, I don't want to be responsible for a destroyed db (to do this goto the \data folder in mysql and copy out the eq folder, you can paste it back if all goes wrong) **lol**

once your on it type
Quote:
USE eq;
to select that db, or whatever you called it then
Quote:
SHOW TABLES;
and it will list all the tables in the db,
Quote:
DESCRIBE <tablename>;
will tell you what the table is made up of for example:
Quote:
mysql> DESCRIBE inventory;
+---------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-----------------------+------+-----+---------+-------+
| charid | int(10) unsigned | YES | | 0 | |
| slotid | smallint(6) unsigned | YES | MUL | 0 | |
| itemid | mediumint(7) unsigned | YES | | 0 | |
| charges | tinyint(3) unsigned | YES | | 0 | |
| color | int(11) unsigned | | | 0 | |
+---------+-----------------------+------+-----+---------+-------+
5 rows in set (0.10 sec)
To view records in the db type
Quote:
SELECT <fields> FROM <table> WHERE <clause>;
Example: SELECT id, name, password, status FROM account WHERE status > 200;
Example: SELECT id, name, password, status FROM account WHERE name LIKE '%eq%'
Note that % is the wildcard in mySQL, to add a record type
Quote:
INSERT INTO <table> VALUES (<values>)
Example: INSERT INTO forage VALUES (0, 100, 1001, 1);
To change an Existing record do:
Quote:
UPDATE <table> SET <field>=<newvalue> WHERE <clause>;
Example: UPDATE accounts SET password='newpassword', status=200 WHERE name like '%eqemu%';
To delete a record type
Quote:
DELETE FROM <table> WHERE <clause>;
Example: DELETE FROM zone_points WHERE id=101;
to Delete a database or table type:
Quote:
DROP TABLE <tablename>; or DROP DATABASE <dbname>;
Example: DROP DATABASE eq; <Don't try it :P
to create a table do:
Quote:
CREATE TABLE <tablename>(<fieldname> <type>)
Example: CREATE TABLE people (name varchar(20), age int(3), dob date);
to create a db type
Quote:
CREATE DATABASE <dbname>;
Example: CREATE DATABASE eq2;
to make a source file you need to run another program call mysqldump (in the same dir as mysql) type at a command prompt:
Quote:
mysqldump <db> <table>
Example: mysqldump eq, account;
and to source it in as you know its
Quote:
source <path>;
How that was what you wanted??
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 08:01 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3