Author: plavin
Date: 2007-03-26 15:17:32 +0200 (Mon, 26 Mar 2007)
New Revision: 5560
Log:
Minor changes, reformat
Modified:
trunk/userguide/excel-mysql.xml
Modified: trunk/userguide/excel-mysql.xml
===================================================================
--- trunk/userguide/excel-mysql.xml 2007-03-26 06:50:41 UTC (rev 5559)
+++ trunk/userguide/excel-mysql.xml 2007-03-26 13:17:32 UTC (rev 5560)
Changed blocks: 16, Lines Added: 54, Lines Deleted: 56; 10678 bytes
@@ -37,7 +37,7 @@
<para>
This article deals with migrating a spreadsheet to a MySQL
database. The solution presented here is operating system (OS)
- neutral; it works on Mac, Windows, or any UNIX-like OS.
+ neutral; it works on Mac, Windows, or any Unix-like OS.
</para>
<para>
@@ -48,21 +48,21 @@
</para>
<para>
- We are also going to make use of <literal>Query Browser</literal>,
- one of the open source MySQL GUI Tools. The MySQL GUI Tools
- provide a suite of desktop applications for the administration and
- manipulation of MySQL databases. In particular, the Query Browser
- is a tool for creating and executing queries from within a
- graphical environment. Creating database objects is made
- especially easy using the <literal>Table Editor</literal>, a
- feature of the Query Browser also common to other GUI Tools. By
- pointing and clicking you can quickly build a table without
- knowing anything about data definition language (DDL). Not only
- will the table editor help you work more quickly, but it's a good
- way to learn MySQL's implementation of SQL. Any alterations made
- to a table using the graphical interface are shown as SQL
- statements, making it easy to learn the appropriate SQL commands.
- We'll take advantage of this feature to document as we go.
+ We are also going to make use of Query Browser, one of the open
+ source MySQL GUI Tools. The MySQL GUI Tools provide a suite of
+ desktop applications for the administration and manipulation of
+ MySQL databases. In particular, the Query Browser is a tool for
+ creating and executing queries from within a graphical
+ environment. Creating database objects is made especially easy
+ using the <literal>Table Editor</literal>, a feature of the Query
+ Browser also common to other GUI Tools. By pointing and clicking
+ you can quickly build a table without knowing anything about data
+ definition language (DDL). Not only will the table editor help you
+ work more quickly, but it's a good way to learn MySQL's
+ implementation of SQL. Any alterations made to a table using the
+ graphical interface are shown as SQL statements, making it easy to
+ learn the appropriate SQL commands. We'll take advantage of this
+ feature to document as we go.
</para>
<para>
@@ -296,9 +296,10 @@
<guilabel>Schemata</guilabel> tab on the right is selected, right
click anywhere in this window, and choose the <guimenu>Create
Schema</guimenu> option from the pop-up menu. Name the database
- <literal>association</literal>. It should appear in the
- <guilabel>Schemata</guilabel> window. Next open a script window
- — we'll use it as a scratch pad to save copies of the
+ <literal>association</literal>. To refresh the databases shown in
+ the <guilabel>Schemata</guilabel> window, right click in this
+ window and choose the refresh menu option. Next open a script
+ window — we'll use it as a scratch pad to save copies of the
queries we create. Open a script tab by choosing the <guimenu>New
Script Tab</guimenu> option from the <guimenu>File</guimenu>
menu.
After doing this two tabs, one labeled
@@ -316,7 +317,7 @@
<para>
This opens the table editor, in the default view with the
<guilabel>Columns and Indices</guilabel> tab active. Enter the
- table name <literal>alldata</literal> in the text box at the top
+ name <literal>alldata</literal> in the text box at the top
of the table editor. Refer to the values shown in
<xref linkend="designing-table"/>, enter a name for each column,
choose <literal>VARCHAR</literal> as the data type, and specify a
@@ -338,7 +339,7 @@
`lastname` VARCHAR(50) NOT NULL,
`firstname` VARCHAR(50) NOT NULL,
`certification` VARCHAR(10) NOT NULL,
- `certificationdate` VARCHAR(10) NOT NULL,
+ `expirydate` VARCHAR(10) NOT NULL,
`streetaddress1` VARCHAR(50) NOT NULL,
`streetaddress2` VARCHAR(50) NOT NULL,
`city` VARCHAR(50) NOT NULL,
@@ -370,7 +371,7 @@
</para>
<para>
- Click on the <literal>Resultset1</literal> tab and enter the
+ Click on the <guilabel>Resultset1</guilabel> tab and enter the
following statement into the query text box:
</para>
@@ -406,7 +407,7 @@
DATA INFILE</literal> statement. The rules for using a relative
path are a bit tricky so always specify the complete path to the
file. Also, a data file must be readable by all. This is usually
- not an issue under Windows and on UNIX operating systems, if you
+ not an issue under Windows; on Unix operating systems, if you
need to adjust the file permissions, you can readily do this using
the GUI. To make a file world-readable from the command prompt
type:
@@ -679,19 +680,19 @@
<programlisting>
`certification` VARCHAR(10) NOT NULL
-`certificationdate` VARCHAR(10) NOT NULL,
+`expirydate` VARCHAR(10) NOT NULL,
`certificationnumber` VARCHAR(10) NOT NULL
</programlisting>
<para>
- So far we've treated the <literal>certificationdate</literal>
- field as text. While we're creating a member accreditations table
- we can convert this field to the DATE data type. The new
- definition for this field is:
+ So far we've treated the <literal>expirydate</literal> field as
+ text. While we're creating a member accreditations table we can
+ convert this field to the DATE data type. The new definition for
+ this field is:
</para>
<programlisting>
-`certificationdate` DATE DEFAULT NULL
+`expirydate` DATE DEFAULT NULL
</programlisting>
<para>
@@ -753,7 +754,7 @@
SELECT CONCAT(firstname,lastname,city) AS unique_value,
certification, 0 AS memberid,
certificationnumber,
- STR_TO_DATE(certificationdate, "%d-%b-%y")
+ STR_TO_DATE(expirydate, "%d-%b-%y")
FROM alldata;
</programlisting>
@@ -827,8 +828,9 @@
Rename the table to <literal>members</literal>, by changing the
table name in the text box in the top left of the table editor.
Select the <literal>unique_value</literal> field and press the
- <keycap>Delete</keycap> key to remove it. Choose <literal>Apply
- Changes</literal> to view a dialog box with the following content:
+ <keycap>Delete</keycap> key to remove it. Choose <guibutton>Apply
+ Changes</guibutton> to view a dialog box with the following
+ content:
</para>
<programlisting>
@@ -1089,12 +1091,11 @@
switches as the MySQL client; as you can see, you specify your
user name and password in the same way. You also need to specify
the database name you wish to dump. In this case, the output is
- redirected to a script file named <literal>newdb.sql</literal>.
- If you do not wish to create a database and only want to dump the
- tables in the <literal>association</literal> database,
- execute the preceding command without the <option>--databases</option>
- option. For more
- information about the many options available with
+ redirected to a script file named <literal>newdb.sql</literal>. If
+ you do not wish to create a database and only want to dump the
+ tables in the <literal>association</literal> database, execute the
+ preceding command without the <option>--databases</option> option.
+ For more information about the many options available with
<literal>mysqldump</literal> see
<ulink url="&base-url-docs;5.0/en/mysqldump.html"></ulink>.
</para>
@@ -1103,9 +1104,8 @@
Have a look at the contents of the script file so that you
understand what it does. Any existing tables with the specified
table names will be dropped and recreated and then the data will
- be inserted. If you are overwriting existing data,
- you may want to back up your data before running the
- script file.
+ be inserted. If you are overwriting existing data, you may want to
+ back up your data before running the script file.
</para>
<para>
@@ -1118,25 +1118,23 @@
<programlisting>
shell> <command>mysql</command> <option>-u</option>
<replaceable>peter</replaceable> -p < newdb.sql
</programlisting>
-
+
<note>
<para>
- If you saved only the database tables, you must specify a database
- when issuing the preceding command.
+ If you saved only the database tables, you must specify a
+ database when issuing the preceding command.
</para>
</note>
-
<para>
If you have remote access to your production server simply add the
- <option>-h</option> <replaceable>hostname</replaceable>
option
- to the preceding command. You may also
- upload your script using an application such as
- <literal>phpMyadmin</literal>. Finally, you can open and execute
- the script file from within Query Browser — but more about
- this in the next section.
+ <option>-h</option> <replaceable>hostname</replaceable>
option to
+ the preceding command. You may also upload your script using an
+ application such as <literal>phpMyadmin</literal>. Finally, you
+ can open and execute the script file from within Query Browser
+ — but more about this in the next section.
</para>
-
+
</section>
<section id="updating-from-spreadsheet">
@@ -1206,7 +1204,7 @@
`lastname` VARCHAR(50) NOT NULL,
`firstname` VARCHAR(50) NOT NULL,
`certification` VARCHAR(10) NOT NULL,
- `certificationdate` VARCHAR(10) NOT NULL,
+ `expirydate` VARCHAR(10) NOT NULL,
`streetaddress1` VARCHAR(50) NOT NULL,
`streetaddress2` VARCHAR(50) NOT NULL,
`city` VARCHAR(50) NOT NULL,
@@ -1267,9 +1265,9 @@
SELECT CONCAT(firstname,lastname,city) AS unique_value,
certification, 0 AS memberid,
certificationnumber,
- STR_TO_DATE(certificationdate, "%d-%b-%y")
+ STR_TO_DATE(expirydate, "%d-%b-%y")
FROM alldata;
-#Above format for 12-Dec-07
+#Above format for 31-Dec-07
#for 12/1/2007 use "%c/%e/%Y"
#now relate the two tables and insert ids into the tempmemberaccreditations
@@ -1322,7 +1320,7 @@
FROM (`memberaccreditations` `tma`
LEFT JOIN `members` `t` ON ((`tma`.`memberid` = `t`.`id`)))
WHERE ISNULL(`t`.`id`);
-#remove spreadsheet based table
+#remove spreadsheet-based table
DROP TABLE IF EXISTS `alldata`;
</programlisting>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r5560 - trunk/userguide | plavin | 26 Mar |