Unix Databases
The main databases available on our system
are mSQL and mySQL . They can be accessed via
PHP (probably the most widely used
method) or via the mSQL prompt via telnet (If you want to try this, get the mSQL docs first!).
Note: XyNexT offers mSQLand mySQL databases as a free
service to our premium customers. We do not provide
tech support for databases; however, we have excellent tutorials on our site regarding mSQL and PHP.
"mSQL is a lightweight database engine designed to provide fast
access to stored data with
low memory requirements." - mSQL Manual
Note: The only types of database
that XyNexT
permits on our system are mSQL and mySQL; other database types make heavy use
of system resources. Allowing them would negatively impact the performance of other
clients' websites.
First, some basics:
For example, if your domain name is xyz.com,
the name of your database will be:
xyz
After we have created your database, you can then
manipulate the tables how you want to. It's usually easiest to do by using text files and
passing them to the database, like so:
Text file textfile.sql containing:
create table tablename (
name char(40),
address char(40),
id_number int)
\g
and passing to mSQL by issuing the command:
msql databasename < textfile.sql
Much easier than that clunky mSQL monitor! (No offense to Bambi!)
Want to do a quick and easy backup of your database? Use
msqldump! Just follow these steps:
Run the command msqldump databasename > filename.dump.
This creates a flat ascii file with all of the commands necessary to totally recreate your
mSQL database. (If you just run msqldump databasename without directing
it to a file, then it echoes to the screen! Yuck, yuck, phooey, phooey!)
You can use this for a daily backup, delete or manipulate your tables,
whatever. As long as you have this ascii file, you're OK.
If you are experiencing problems with a table (key fields not working
properly, spaces inserted into integers, etc.), then you can run an msqldump, delete the
current structure, and feed the data back in with the command
msql databasename < filename.dump. All better now!
Sample Msqldump for Database TEST
#
# mSQL Dump (requires mSQL-1.0.6 or better)
#
# Host: localhost Database: test
#--------------------------------------------------------
#
# Table structure for table 'TABLE01'
#
CREATE TABLE TABLE01 (
she CHAR(32),
him CHAR(32),
three CHAR(32)
) \g
#
# Dumping data for table 'TABLE01'
#
INSERT INTO TABLE01 VALUES ('Anna','Franz','Otto')\g
INSERT INTO TABLE01 VALUES ('Sabine','Thomas','Pauline')\g
INSERT INTO TABLE01 VALUES ('Jane','Paul','Jah')\g
#
# Table structure for table 'TABLE02'
#
CREATE TABLE TABLE02 (
she CHAR(32),
him CHAR(32),
three CHAR(32)
) \g
#
# Dumping data for table 'TABLE02'
#
INSERT INTO TABLE02 VALUES ('Anna','Franz','Otto')\g
INSERT INTO TABLE02 VALUES ('Sabine','Thomas','Pauline')\g
INSERT INTO TABLE02 VALUES ('Jane','Paul','Jah')\g
#
# Table structure for table 'TABLE03'
#
CREATE TABLE TABLE03 (
she CHAR(32),
him CHAR(32),
three CHAR(32)
) \g
#
# Dumping data for table 'TABLE03'
#
INSERT INTO TABLE03 VALUES ('Anna','Franz','Otto')\g
INSERT INTO TABLE03 VALUES ('Sabine','Thomas','Pauline')\g
INSERT INTO TABLE03 VALUES ('Jane','Paul','Jah')\g
#
# Table structure for table 'TABLE04'
#
CREATE TABLE TABLE04 (
she CHAR(32),
him CHAR(32),
three CHAR(32)
) \g
#
# Dumping data for table 'TABLE04'
#
INSERT INTO TABLE04 VALUES ('Anna','Franz','Otto')\g
INSERT INTO TABLE04 VALUES ('Sabine','Thomas','Pauline')\g
INSERT INTO TABLE04 VALUES ('Jane','Paul','Jah')\g
#
# Table structure for table 'TABLE05'
#
CREATE TABLE TABLE05 (
she CHAR(32),
him CHAR(32),
three CHAR(32)
) \g
#
# Dumping data for table 'TABLE05'
#
INSERT INTO TABLE05 VALUES ('Anna','Franz','Otto')\g
INSERT INTO TABLE05 VALUES ('Sabine','Thomas','Pauline')\g
INSERT INTO TABLE05 VALUES ('Jane','Paul','Jah')\g
For more tutorials on mSQL and PHP, please refer to our tutorial
table of contents
|