neysx 05/08/24 14:47:01 Modified: xml/htdocs/doc/en/draft mysql-howto.xml Log: More info about insert into, typo fixes, coding style...
Revision Changes Path 1.2 +134 -141 xml/htdocs/doc/en/draft/mysql-howto.xml file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/draft/mysql-howto.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/draft/mysql-howto.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/draft/mysql-howto.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo Index: mysql-howto.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/draft/mysql-howto.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mysql-howto.xml 24 Aug 2005 11:51:02 -0000 1.1 +++ mysql-howto.xml 24 Aug 2005 14:47:01 -0000 1.2 @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE guide SYSTEM "http://www.gentoo.org/dtd/guide.dtd"> -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/draft/mysql-howto.xml,v 1.1 2005/08/24 11:51:02 fox2mike Exp $ --> +<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/draft/mysql-howto.xml,v 1.2 2005/08/24 14:47:01 neysx Exp $ --> -<guide link="/doc/en/mysql-howto.xml"> +<guide link="/doc/en/draft/mysql-howto.xml"> <!--Remove draft/ when mv'ing up to /doc/en/ --> <title>MySQL Startup Guide</title> <author title="Author"> @@ -11,9 +11,12 @@ <author title="Editor"> <mail link="[EMAIL PROTECTED]">Shyam Mani</mail> </author> +<author title="Editor"> + <mail link="[EMAIL PROTECTED]">Xavier Neys</mail> +</author> <abstract> -This document helps a user setup and use MySQL. +This document helps a user set up and use MySQL. </abstract> <!-- The content of this document is licensed under the CC-BY-SA license --> @@ -32,10 +35,10 @@ <p> MySQL is a popular database server that is used in various applications. SQL stands for (S)tandard (Q)uery (L)anguage, which is what MySQL uses to -communicate with other programs. On top of that, MySQL has its own expanded -SQL functions to provide additional functionality to users. In this document, -we'll look at how to do the initial MySQL installation, setup databases and -tables and create new users. Let's start out with the installation. +communicate with other programs. On top of that, MySQL has its own expanded SQL +functions to provide additional functionality to users. In this document, we'll +look at how to do the initial MySQL installation, set up databases and tables, +and create new users. Let's start out with the installation. </p> </body> @@ -72,9 +75,9 @@ <c>ENTER</c> when prompted while configuring the MySQL database. The configuration sets up the main MySQL database which contains administrative information such as databases, tables, users, permissions and more. The -configuration recommends that you change your root password as soon as possible. -We will definitely do this, otherwise someone could come along by chance and -hack our default setup MySQL server. +configuration recommends that you change your root password as soon as +possible. We will definitely do this, otherwise someone could come along by +chance and hack our default setup MySQL server. </p> <pre caption="MySQL configuration"> @@ -108,11 +111,11 @@ so as to keep this document as consistent as possible)</comment> * For security reasons you should set your MySQL root - * password as soon as possible. + * password as soon as possible. </pre> <impo> -As of mysql-4.0.24-r2, passwords are entered during the config phase making +As of mysql-4.0.24-r2, passwords are entered during the config phase making root password entry more secure. </impo> @@ -124,7 +127,7 @@ <pre caption="Setting up your MySQL root password"> # <i>/etc/init.d/mysql start</i> * Re-caching dependency info (mtimes differ)... - * Starting mysqld (/etc/mysql/my.cnf) ... [ ok ] + * Starting mysqld (/etc/mysql/my.cnf) ... [ ok ] <comment>(Replace new-password with your desired password)</comment> # <i>/usr/bin/mysqladmin -u root -h localhost password 'new-password'</i> </pre> @@ -165,7 +168,7 @@ <body> <p> -We have logged in and have a mysql prompt displayed. First let's take a look at +We have logged in and a mysql prompt is displayed. First let's take a look at the databases we currently have. To do so, we use the <c>SHOW DATABASES</c> command. </p> @@ -186,9 +189,9 @@ </impo> <p> -Despite the fact that a test database is already created, we are going to create -our own. Databases are created using the <c>CREATE DATABASE</c> command. We'll -create one named "gentoo". +Despite the fact that a test database is already created, we are going to +create our own. Databases are created using the <c>CREATE DATABASE</c> command. +We'll create one named "gentoo". </p> <pre caption="Creating the gentoo database"> @@ -218,12 +221,12 @@ </pre> <p> -Indeed our database has been created. In order to work with creating tables -for our new gentoo database, we need to select it as our current database. -To do so, we use the<c>USE</c> command. The <c>USE</c> command takes the -name of the database you wish to use as your current database. Another -option is to set it on the command line after the <c>-p</c> switch. Let's go -ahead and switch to the gentoo database. +Indeed our database has been created. In order to work with creating tables for +our new gentoo database, we need to select it as our current database. To do +so, we use the <c>USE</c> command. The <c>USE</c> command takes the name of the +database you wish to use as your current database. Another option is to set it +on the command line after the <c>-p</c> switch. Let's go ahead and switch to +the gentoo database. </p> <pre caption="Switching our database"> @@ -244,15 +247,15 @@ <chapter> <title>Working With Tables In MySQL</title> <section> -<title>Creating A Table</title> +<title>Creating a Table</title> <body> <p> In the structure of MySQL, there are databases, tables, records, and fields. Databases hold together tables, tables hold together records, records hold together fields, which contain the actual information. This structure lets -users select how they want to access their information. So far we've dealt -with databases, now let's work with tables. First off, tables can be listed +users select how they want to access their information. So far we've dealt with +databases, now let's work with tables. First off, tables can be listed similiarly to databases using the <c>SHOW TABLES</c> command. Right now there are no tables in our gentoo database, as running the command will show us: </p> @@ -265,8 +268,8 @@ <p> This means we need to create some tables. In order to do so, we use the <c>CREATE TABLE</c> command. However, this command is quite different from -simple <c>CREATE DATABASE</c> command. This command takes a list of arguments -you must give it. The form is as follows: +simple <c>CREATE DATABASE</c> command. This command takes a list of arguments. +The form is as follows: </p> <pre caption="CREATE TABLE Syntax"> @@ -278,17 +281,17 @@ let's make a table named <c>developers</c>. This table will contain the developer's name, email and job. <b>field_name</b> will contain the name of the field. We have 3 required names in this case: name, email, and job. The -<b>field_data_type</b> is what type of information will be stored. The different -formats avaliable can be found at the <uri +<b>field_data_type</b> is what type of information will be stored. The +different formats available can be found at the <uri link="http://dev.mysql.com/doc/mysql/en/column-types.html">MySQL Column Types Page</uri>. For our purposes, we'll use the <c>VARCHAR</c> data type for all of -our fields. <c>VARCHAR</c> is one of the simplest of data types when it comes to -working with strings. <b>size</b> is how much of data a single field will store -of type <b>field_data_type</b>. In this case, we'll use 128 for our size. This -means that the field can have <c>VARCHAR</c> data that is 128 bits. You can -safely think of this as 128 characters for the time being, though there is a -somewhat more technical explanation that the above site will provide you with. -Now that we know how we are going to create the table, let's do it. +our fields. <c>VARCHAR</c> is one of the simplest of data types when it comes +to working with strings. <b>size</b> is how much of data a single field will +store. In this case, we'll use 128. This means that the field can have +<c>VARCHAR</c> data that is 128 bytes. You can safely think of this as 128 +characters for the time being, though there is a somewhat more technical +explanation that the above site will provide you with. Now that we know how we +are going to create the table, let's do it. </p> <pre caption="Creating our table"> @@ -297,8 +300,8 @@ </pre> <p> -Looks like our table was created ok. Let's check it with the <c>SHOW -TABLES</c> command: +Looks like our table was created ok. Let's check it with the <c>SHOW TABLES</c> +command: </p> <pre caption="Verifying our table"> @@ -312,10 +315,10 @@ </pre> <p> -Yes, there's our table. However, it doesn't seem to have any information on -- [email protected] mailing list
