Thread: "Source this"
View Single Post
  #2  
Old 10-27-2010, 02:15 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

Quote:
Originally Posted by revloc02c View Post
What does "source this" mean?

As in:
"Source schema.sql (in the editor's /sql directory) into your database."


or another example:
"Source this:
CREATE TABLE rule_sets (
ruleset_id TINYINT UNSIGNED NOT NULL auto_increment,
name VARCHAR(255) NOT NULL,
PRIMARY KEY(ruleset_id)
);
INSERT INTO rule_sets VALUES(0, "default");
UPDATE rule_sets SET ruleset_id=0;
CREATE TABLE rule_values (
ruleset_id TINYINT UNSIGNED NOT NULL,
rule_name VARCHAR(64) NOT NULL,
rule_value VARCHAR(10) NOT NULL,
INDEX(ruleset_id),
PRIMARY KEY(ruleset_id,rule_name)
);"

Mind you, I don't want an explanation of the code block above--what it does and why, I just want to know what "Source this" means you are supposed to do with it.
It means load the mysql .sql file into your database. For the example listed, open up a MySQL command prompt and type "source schema.sql;"

If you are in the same folder as the SQL file on the command prompt, it will begin entering that schematics into the database. In this example, it is a table. It can also enter rows of data into your database, I always check what's being added before I 'source' it.

Hope that elaborates on it some.
Reply With Quote