Errata

Learning MySQL

Errata for Learning MySQL

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page xi
?the staff is? should be ?the staff are?

Anonymous   
Printed
Page xv
under "Using Code Examples":

"Ttahaghoghi"
should be
"Tahaghoghi"

Anonymous   
Printed
Page xi

"the staff is" should be "the staff are"

Anonymous   
Printed
Page xv
under "Using Code Examples":

"Ttahaghoghi"
should be
"Tahaghoghi"

Anonymous   
Printed
Page xv, xvi, 8, 104, etc.
n/a

The website is no longer available at http://learningmysql.com; it has been moved to http://tahaghoghi.com/LearningMySQL/

All references to learningmysql.com should be updated.

O'Reilly Media
 
Jan 11, 2011 
Printed
Page 8
lines 3-4

"won't spent" -> "won't spend"

Anonymous   
Printed
Page 8
lines 3-4

"won't spent" -> "won't spend"

Anonymous   
Printed
Page 10
para 2, last sentence

Insert ?to work together? after ?Perl?

Anonymous   
Printed
Page 10
para 2, last sentence

Insert "to work together" after "Perl"

Anonymous   
Printed
Page 16

Change:

Our previous two examples would be written as:
$ chmod 644 myfile.txt
and:
$ chmod 777 mydir

to:

Using this notation our previous three examples would be written as:
$ chmod 644 myfile.txt
$ chmod 600 myfile.txt
$ chmod 777 mydir

Anonymous  Jan 10, 2011 
Printed
Page 19
?filename? should be ?myfile.txt? in examples.

Anonymous   
Printed
Page 19

"filename" should be "myfile.txt" in examples.

Anonymous   
Printed
Page 19
Middle

$ pico filename

Should be:

$ pico myfile.txt

Anonymous  Jan 19, 2011 
Printed
Page 22
bullet 2

Version is now 5.0.26

Anonymous   
Printed
Page 22
bullet 2

Version is now 5.0.26

Anonymous   
Printed
Page 23
last sentence

Insert ?box? after ?dialog?

Anonymous   
Printed
Page 23
last sentence

Insert "box" after "dialog"

Anonymous   
Printed
Page 25
note

?i386? should be ?i686?

Anonymous   
Printed
Page 25
note

"i386" should be "i686"

Anonymous   
Printed
Page 26
Second paragraph under ?Installing MySQL on Linux using RPM Packages?

Add ?Packages with higher CPU numbers, such as i586 or i686, are better tuned for newer machines, but won?t work on older machines.

Anonymous   
Printed
Page 26
Second paragraph under Installing MySQL on Linux using RPM Packages

Change:

be called something like MySQL-server-5.0.22-0.i386.rpm and MySQL-client-5.0.22-0.i386.rpm

to:

be called something like MySQL-server-5.0.22-0.i386.rpm and MySQL-client-5.0.22-0.i386.rpm. Packages with higher CPU numbers, such as i586 or i686, are better tuned for newer machines, but won't work on older machines.

Anonymous   
Printed
Page 58
Upper (Figure 2-14)

C:\mysql-4.1.14-win32>

Should be:

C:\mysql-5.0.22-win32>

Anonymous  Jan 19, 2011 
Printed
Page 61
Under ?Installing Under Mac OS X?

?noninstallation? should be ?non-installation? in the second bullet point.

Anonymous   
Printed
Page 61
Under Installing Under Mac OS X

"noninstallation" should be "non-installation" in the second bullet point.

Anonymous   
Printed
Page 61
Upper

The XAMPP installation has PHP configured, with

Should be:

The XAMPP installation may have PHP configured, with

Anonymous  Jan 19, 2011 
Printed
Page 67
Lower

The installer package is in the StuffIt Expander (.sitx) format. If you get a screen of garbled text in your browser when trying to download it, press the "back" button to see the download link - for example, http://easynews.dl.sourceforge.net/sourceforge/xampp/xampp-macosx-0.3.sitx. Hold down the Ctrl key and click on the link. From the menu that appears, select the entry that says Download Linked File (for Safari), Save Link As (for Firefox), or Download Link to Disk (for Internet Explorer).

Once the StuffIt archive is downloaded, double-click on it to extract the installation package, and then double-click on the installation package to start the XAMPP installation program. When the decompression program finishes, you should find the installation program saved in the same directory as the downloaded file, or on your Desktop. This installation program has a name like xampp-macosx-0. 5.pkg. Running this and accepting the default settings will install XAMPP to the /Applications/xampp/ directory, with the MySQL datafiles located in the /Applications/xampp/xamppfiles/var/mysql directory.


Should be:


This installer package is in the form of a disk image file (.dmg). The Safari web browser will automatically mount this disk image and start the installer. If you're using a different browser, you'll need to double-click on the downloaded file to mount it; you can then drag the XAMPP folder in this disk image to your Applications folder. This install XAMPP to the /Applications/XAMPP/ directory, with the MySQL datafiles located in the /Applications/XAMPP/xamppfiles/var/mysql directory. The XAMPP on Mac OS X examples in this book were written for older versions of XAMPP that installed to the /Applications/xampp/ directory; please be prepared to replace references to the old (lowercase xampp) path with the new one (uppercase XAMPP).

Anonymous  Jan 19, 2011 
Printed
Page 69
Lower


you may wonder whether you it's

Should be:

you may wonder whether it's

Anonymous  Jan 19, 2011 
Printed
Page 71
Middle


MySQL server newer than 4.1.0

Should be:

MySQL server from 4.1.0 onwards

Anonymous  Jan 19, 2011 
Printed
Page 73
Middle

Under Linux, change to your MySQL base directory and type:
$scripts/mysql_fix_privilege_tables \
--user=root \
--password=the_mysql_root_password


Should be:


Under Linux, change to your MySQL base directory and type:
$scripts/mysql_fix_privilege_tables \
--user=root \
--password=the_mysql_root_password

On some Linux installations, mysql_fix_privilege_tables is in the MySQL bin directory; if the above command doesn't work, try this:
$bin/mysql_fix_privilege_tables \
--user=root \
--password=the_mysql_root_password

Anonymous  Jan 19, 2011 
Printed
Page 74
Lower

The ellipsis (...) symbols indicate where we've left out some of the program output.

Should be:

The ellipsis (...) symbols indicate where we've left out some of the program output.

You may need to run mysql_secure_installation as the system root user (see the instructions earlier in this Chapter in "Following the Instructions in This Book"):
# bin/mysql_secure_installation

On Mac OS X, you may also need to create a symbolic link to the mysql command-line client program by typing:
# ln -s /usr/local/mysql/bin/mysql /opt/local/bin/mysql

Anonymous  Jan 19, 2011 
Printed
Page 75
Change ?password? to ?mypass? in examples.

Anonymous   
Printed
Page 75

Change "password" to "mypass" in examples.

Note from the Author or Editor:
For example, you might type:
# export http_proxy=http://adam:password@proxy.mycompany.com:8080
# export ftp_proxy=http://adam:password@proxy.mycompany.com:8080

Should be:

For example, you might type:
# export http_proxy=http://adam:mypass@proxy.mycompany.com:8080
# export ftp_proxy=http://adam:mypass@proxy.mycompany.com:8080

Anonymous   
Printed
Page 76
In the third line of code, there shouldn?t be quotes in the user input.

Anonymous   
Printed
Page 76
third line of code

In the third line of code there shouldn't be quotes in the user input.

Anonymous   
Printed
Page 79
para 4

?Hold down? should be ?press?.

Anonymous   
Printed
Page 79
para 4

"Hold down" should be "press".

Note from the Author or Editor:
Hold down Ctrl-C to exit the more program.

Should be:

Press Ctrl-C to exit the more program.

Anonymous   
Printed
Page 80
Under ?Server Doesn?t Stop,? insert ?and the password, if any,? after ?username?.

Insert ??password-che-root.password? after ?user-root? in example.

Anonymous   
Printed
Page 80

Change:

You can do this by specifying the username from the command line:
$ bin/mysqladmin --user=root shutdown

to:

You can do this by specifying the root username and password from the command line:
$ bin/mysqladmin --user=root --password=the-root-password shutdown

Anonymous   
Printed
Page 83
Lower

or the apachectl command described later

Should be:

or the apachectl or apache2ctl commands described later

Anonymous  Jan 19, 2011 
Printed
Page 84
Lower

Windows
/mnt/c/Program Files/xampp/apache/conf/httpd.conf for an XAMPP installation

Should be:

Windows
C:\Program Files\xampp\apache\conf\httpd.conf for an XAMPP installation

Anonymous  Jan 19, 2011 
Printed
Page 85
Insert ?file? after ?script? in the second sentence under ?Stopping and Starting Apache?

Anonymous   
Printed
Page 85

Change:

On Linux systems, it's increasingly common to find servers configured in a modular way, with a main configuration file that reads in other files, typically under the directory /etc/httpd/modules.d.

to:

It's increasingly common to find servers configured in a modular way, with a main configuration file that reads in other files, for example under the directory /etc/httpd/modules.d on a Linux system, or in the apache\conf\extra directory under the XAMPP install directory.

Anonymous   
Printed
Page 85
under "Starting and Stopping Apache"

I am using version 10.2 of the openSUSE distribution of Linux.

Under this OS, it seems that the proper command for starting and stopping Apache is rcapache2 instead of apachectl. Using the later does not update the files under /etc/apache2/sysconfig.d/ from the /etc/sysconfig/apache2 configuration file. This results in two errors.

First, Apache won't start because it is missing the /etc/apache2/sysconfig.d/include.conf file. You'll see the error message "httpd2: Syntax error on line 188 of /etc/apache2/httpd.conf: Could not open configuration file /etc/apache2/sysconfig.d/include.conf: No such file or directory"

Second, the /etc/apache2/sysconfig.d/loadmodule.conf is not updated; so, it won't load the PHP module.

Note from the Author or Editor:
page 85: In the Section: "Starting and Stopping Apache", change:
"You can generally start an installed Apache server by using the command:
apachectl start
If this fails because the command isn't found, use the find command to try and locate the apachectl script file:
find / -type f -name apachectl
If it's reported as being"

to:

"Apache web server installations usually include a control script called apachectl that you can use to start or stop the server. On newer installations this is sometimes called apache2ctl; if the examples below don't work for you, try replacing apachectl with apache2ctl or rcapache2.
You can generally start an installed Apache server by using the command:
apachectl start
If you get an error message saying the apachectl file can't be found, try locating it yourself. On a Linux or Mac OS X system use:
find / -type f -name apachectl
while on a Windows system, use the built-in search.
If the apachectl file is reported as being"

Anonymous   
Printed
Page 87
Under ?Setting Up Perl?

?nontrivial? should be ?complex.?

Anonymous   
Printed
Page 87
Under "Setting Up Perl"

"nontrivial" should be "complex."

Note from the Author or Editor:
If you're not planning to write nontrivial Perl scripts

Should be:

If you're not planning to write complex Perl scripts

Anonymous   
Printed
Page 91
Upper

You can download and install the DBI module, the MySQL driver, and the CGI module for the XAMPP Perl installation by typing these commands in turn:
$ sudo /Applications/xampp/xamppfiles/bin/perl -MCPAN -e 'install DBI;'
$ sudo /Applications/xampp/xamppfiles/bin/perl -MCPAN -e 'install DBD::mysql;'
$ sudo /Applications/xampp/xamppfiles/bin/perl -MCPAN -e 'install CGI;'


Should be:


You'll can get various required configuration and header files by downloading the XAMPP "Developer package". The current version is xampp-macosx-0.7.4-dev.tar.gz; open this archive and copy the contents of the xamppfiles directory to /Applications/xampp/xamppfiles. One way to do this is:
$ cd /Applications/xampp
$ sudo tar zxvf ~my_user_name/xampp-macosx-0.7.4-dev.tar.gz

You can download and install the CGI and DBI modules by typing:
$ sudo /Applications/xampp/xamppfiles/bin/perl -MCPAN -e 'install DBI;'
$ sudo /Applications/xampp/xamppfiles/bin/perl -MCPAN -e 'install CGI;'

To install the MySQL driver (DBD::mysql), follow these steps:
$ sudo /Applications/xampp/xamppfiles/bin/cpan
cpan> o conf makepl_arg --mysql_config=/Applications/xampp/xamppfiles/bin/mysql_config
cpan> install DBD::mysql
cpan> quit

Anonymous  Jan 19, 2011 
Printed
Page 97
Align ?>? throughout.

Anonymous   
Printed
Page 97

Align ">" throughout.

Anonymous   
Printed
Page 97
Upper

There are two databases here;

Should be:

You may see different results on your MySQL server. There are two databases here;

Anonymous  Jan 19, 2011 
Printed
Page 98
In the first sentence under ?The Monitor Help,?

Take ?HELP? out of user-input font throughout the chapter, such as on p. 100.

Anonymous   
Printed
Page 98
In the first sentence under "The Monitor Help,"

Take "HELP" out of user-input font throughout the chapter, such as on p. 100.

Anonymous   
Printed
Page 99
lower

by typing rebuild

Should be:

by typing rehash

Anonymous  Jan 19, 2011 
Printed
Page 100
Upper

You can get information on individual topics

Should be:

You may see more or less help content depending on the help files that have been installed with your server. You can get information on individual topics

Anonymous  Jan 19, 2011 
Printed
Page 102
Change ?password? to ?mypass? in examples.

Anonymous   
Printed
Page 102

Change "password" to "mypass" in examples.

Anonymous   
Printed
Page 103
Check font size for ?the_username?.

Anonymous   
Printed
Page 103

Check font size for "the_username".

Anonymous   
Printed
Page 104
Bring ?use? in the first sentence into consistency with the rest of the book?either make it all caps or not. Also, the author says that ?the_mysql_ root_password? and the following example are not supposed to be italicezed.

Anonymous   
Printed
Page 104

Change:

from having to type use the_database_name

to:

from having to type USE the_database_name

Anonymous   
Printed
Page 104
Upper

from having to type use the_database_name

Should be:

from having to type USE the_database_name

Anonymous  Jan 19, 2011 
Printed
Page 109
Change ?his? to ?their? before table.

Anonymous   
Printed
Page 109

Change "his" to "their" before table.

Anonymous   
Printed
Page 109
Lower

for each of his courses:

Should be:

for each of their courses:

Anonymous  Jan 19, 2011 
Printed
Page 110
Align the first letter of the course name in the tables throughout.

Anonymous   
Printed
Page 110

Align the first letter of the course name in the tables throughout.

Anonymous   
Printed
Page 110
Middle

John Paul Bloggs has failed the Computing Mathematics course once with 45 percent,

Should be:

John Paul Bloggs has failed the Computing Mathematics course once with 43 percent,

Anonymous  Jan 19, 2011 
Printed
Page 116
Move ?m? to the customer vertex.



Anonymous   
Printed
Page 116

Move "m" to the customer vertex.

Anonymous   
Printed
Page 116
Upper (Figure 4-4)


Updated image for Figure 4-4.

http://tahaghoghi.com/LearningMySQL/Downloads/Files/UpdatedFigures/Figure.4-4.png

Anonymous  Jan 19, 2011 
Printed
Page 118
Figure 4-5,

"Appplications"
should be
"Applications"

Anonymous   
Printed
Page 118
Figure 4-5,

"Appplications"
should be
"Applications"

Anonymous   
Printed
Page 118
Upper (Figure 4-5)

Updated image for Figure 4-5:

http://tahaghoghi.com/LearningMySQL/Downloads/Files/UpdatedFigures/Figure.4-5.png

Anonymous  Jan 19, 2011 
Printed
Page 121
Move fig 4-10 to this page.

Anonymous   
Printed
Page 121
Move fig 4-10 to this page.

Anonymous   
Printed
Page 122
change the literal tags in the last paragraph as follows

"artist" to "Artist"
"album" to "Album"
"track" to "Track"
"played" to "Played"

Anonymous   
Printed
Page 122
change the literal tags in the last paragraph as follows

"artist" to "Artist"
"album" to "Album"
"track" to "Track"
"played" to "Played"

Anonymous   
Printed
Page 123
Capitalize the first letters of entity names.

Anonymous   
Printed
Page 123
Capitalize the first letters of entity names.

Anonymous   
Printed
Page 126
Upper (Figure 4-13)

Updated image for Figure 4-13:

http://tahaghoghi.com/LearningMySQL/Downloads/Files/UpdatedFigures/Figure.4-13.png

Anonymous  Jan 19, 2011 
Printed
Page 127
2nd to last paragraph

Change ?trips? to ?legs? in the first sentence.

Anonymous   
Printed
Page 127
2nd to last paragraph

Change "trips" to "legs" in the first sentence.

Note from the Author or Editor:
and Melbourne-Christchurch trips.

Should be:

and Melbourne-Christchurch legs.

Anonymous   
Printed
Page 128
Middle

because it's the not of this table,

Should be:

because it's a key not of this table,

Anonymous  Jan 19, 2011 
Printed
Page 131
Upper

Updated image for Figure 4-15:

http://tahaghoghi.com/LearningMySQL/Downloads/Files/UpdatedFigures/Figure.4-15.png

Anonymous  Jan 19, 2011 
Printed
Page 145
middle of page

?a percentage character? should be ?the percentage character.?

Anonymous   
Printed
Page 145
middle of page

"a percentage character" should be "the percentage character."

Note from the Author or Editor:
Most strings used with LIKE contain a percentage character (%)

Should be:

Most strings used with LIKE contain the percentage character (%)

Anonymous   
Printed
Page 145
Lower

mysql> SELECT * FROM track WHERE -> track_name LIKE "R__ %";

Should be:

mysql> SELECT * FROM track WHERE track_name LIKE "R__ %";

Anonymous  Jan 19, 2011 
Printed
Page 146
Align ?>? throughout.

Anonymous   
Printed
Page 146
Throughout page

Align > throughout.

Anonymous   
Printed
Page 149
the query examples should include parentheses as below

mysql> SELECT * FROM album WHERE album_id > 2
-> AND (NOT album_id) = 4 OR album_id = 6;
...
mysql> SELECT * FROM album WHERE (NOT album_id) = 4;
...
mysql> SELECT * FROM album WHERE (NOT album_id) != 4;

Anonymous   
Printed
Page 149
the query examples should include parentheses as below

mysql> SELECT * FROM album WHERE album_id > 2
-> AND (NOT album_id) = 4 OR album_id = 6;
...
mysql> SELECT * FROM album WHERE (NOT album_id) = 4;
...
mysql> SELECT * FROM album WHERE (NOT album_id) != 4;

Anonymous   
Printed
Page 154
?binary? should be all caps in example.

Anonymous   
Printed
Page 154
Example in middle of page

"binary" should be all caps in example.

Note from the Author or Editor:
mysql> SELECT track_name FROM track WHERE track_name < binary 'b';

Should be:

mysql> SELECT track_name FROM track WHERE track_name < BINARY 'b';

Anonymous   
Printed
Page 156
In the last sentence before ?Joining Two Tables? section, reverse ?10? and ?5?.

Anonymous   
Printed
Page 156
last sentence before "Joining Two Tables" section

In the last sentence before "Joining Two Tables" section, reverse 10 and 5.

Note from the Author or Editor:
instead of writing LIMIT 5,10, you can write LIMIT 5 OFFSET 10.

Should be:

instead of writing LIMIT 5,10, you can write LIMIT 10 OFFSET 5.

Anonymous   
Printed
Page 163
middle of page

?auto_increment? should be all caps.

Anonymous   
Printed
Page 163
middle of page

"auto_increment" should be all caps.

Note from the Author or Editor:
You'll learn more about the auto_increment shortcut

Should be:

You'll learn more about the AUTO_INCREMENT shortcut

Anonymous   
Printed
Page 164
Lower



| time | decimal(3,2) | YES | | NULL | |
+----------------------------------------------------------+

Should be:


| time | decimal(5,2) | YES | | NULL | |
+----------------------------------------------------------+

Anonymous  Jan 19, 2011 
Printed
Page 165
second-to-last paragraph

?whose? should be ?for which the?.

Anonymous   
Printed
Page 165
second-to-last paragraph

"whose" should be "for which the".

Note from the Author or Editor:
one whose primary key matches that of

Should be:

for which the primary key matches that of

Anonymous   
Printed
Page 168
Under "The DELETE STATEMENT'

?multitable? should be ?multi-table?

Anonymous   
Printed
Page 168
Under "The DELETE STATEMENT'

multitable should be multi-table

Note from the Author or Editor:
single-table deletes here, and discuss multitable deletes

Should be:


single-table deletes here, and discuss multi-table deletes

Anonymous   
Printed
Page 170
Middle



We discuss indexes in detail in "Keys and Indexes" in Chapter 4.

Should be:

We discuss indexes in detail in "Keys and Indexes" in Chapter 6.

Anonymous  Jan 19, 2011 
Printed
Page 173
Check font on the_mysql_root_password?. Also on 331.

Anonymous   
Printed
Page 173, 331

Check font on the_mysql_root_password.

Anonymous   
Printed
Page 175
Lower



| time | decimal(3,2) | YES | | NULL | |
+----------------------------------------------------------+


Should be:


| time | decimal(5,2) | YES | | NULL | |
+----------------------------------------------------------+

Anonymous  Jan 19, 2011 
Printed
Page 176
Upper



| | `time` decimal(3,2) default NULL, |


Should be:


| | `time` decimal(5,2) default NULL, |

Anonymous  Jan 19, 2011 
Printed
Page 182
Remove ?temporarily? from the end of the first paragraph.

Anonymous   
Printed
Page 182
?default? should be all-caps in examples.

Anonymous   
Printed
Page 182
Upper

Remove "temporarily" from the end of the first paragraph.

Note from the Author or Editor:
Here's how you drop it temporarily:

Should be:

Here's how you drop it:

Anonymous   
Printed
Page 182
Lower

"default" should be all-caps in examples.

Note from the Author or Editor:
we've added two: artist_id SMALLINT(5) NOT NULL default 0 and artist_name CHAR(128) default NULL.

Should be:

we've added two: artist_id SMALLINT(5) NOT NULL DEFAULT 0 and artist_name CHAR(128) DEFAULT NULL.

Anonymous   
Printed
Page 183
4th line from the bottom

than should be that

Anonymous   
Printed
Page 183
4th line from the bottom

than should be that

Note from the Author or Editor:
avoid characters than require you to remember

Should be:

avoid characters that require you to remember

Anonymous   
Printed
Page 183
Upper

The name field is the table name, and it has the same limitations

Should be:

The name field is the column name, and it has the same limitations

Anonymous  Jan 19, 2011 
Printed
Page 187
Delete ?instead? from the ?creating temporary tables? section.

Anonymous   
Printed
Page 187
Middle

Delete "instead" from the "creating temporary tables" section.

Note from the Author or Editor:
it'll instead be removed (dropped)

Should be:

it'll be removed (dropped)

Anonymous   
Printed
Page 191
bottom of page, 3rd sentence up from code exerpt

"You can use the SHOW WARNINGS command to reports"
change "to reports" to "to report"

Anonymous  Jan 14, 2009 
Printed
Page 192
Remove the excess characters in the first ASCII table.

Anonymous   
Printed
Page 192
1st ASCII table

Remove the excess characters in the first ASCII table.

Anonymous   
Printed
Page 197
?From? should be capitalized.

Anonymous   
Printed
Page 197
Make the blank-quote examples one and four spaces for clarity.

Anonymous   
Printed
Page 197
Upper

"From" should be capitalized.

Note from the Author or Editor:
mysql> SELECT * from show_padding WHERE mystring LIKE '% ';

Should be:

mysql> SELECT * FROM show_padding WHERE mystring LIKE '% ';


And


mysql> SELECT * from show_padding;

Should be:

mysql> SELECT * FROM show_padding;

Anonymous   
Printed
Page 197
blank-quote examples

Make the blank-quote examples one and four spaces for clarity.

Anonymous   
Printed
Page 203
Check example beginning with ?SET? for spacing, font.

Anonymous   
Printed
Page 203

Check example beginning with "SET" for spacing, font, and missing parenthesis.


SET('value1'[,'value2'[, ...]]

Should be:

SET('value1'[,'value2'[, ...]])

Anonymous   
Printed
Page 205
Remove the excess space in the example at the end of the page.

Anonymous   
Printed
Page 205
Example at bottom

Remove the excess space in the example at the end of the page.

Note from the Author or Editor:
-> );


Query OK, 0 rows affected (0.06 sec)

Should be:

-> );
Query OK, 0 rows affected (0.06 sec)

Anonymous   
Printed
Page 206
discussion on page

It should be clarified that the table that is created at the top of page 206 does not have any values stored in it, so the forthcoming queries of pages 206-207 will not work. This may puzzle beginners.

Note from the Author or Editor:
You can use the names index for fast searching

Should be:

First, let's insert data for three fictional customers:
mysql> INSERT INTO customer VALUES
-> (1,'Lucy','Elizabeth','Williams'),
-> (2,'Rose','Isabella','Williams'),
-> (3,'Sanaa','Sadat','Tahaghoghi');
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0

You can use the names index for fast searching

Anonymous  Jan 14, 2009 
Printed
Page 213
iddle of page

?despite the file? should be ?despite the files?.

Anonymous   
Printed
Page 213
middle of page

"despite the file" should be "despite the files".

Note from the Author or Editor:
despite the file being typically larger

Should be:

despite the files being typically larger

Anonymous   
Printed
Page 213
Middle

We haven't added a NOT NULL clause to the artist_name. Instead we'll assume that whatever application we build will do the checking for us. The fewer the constraints and conditions that are built into the database, the faster it is for MySQL to work with.

Should be:

We haven't added a NOT NULL clause to the artist_name, and have instead assumed that whatever application we build will do the checking for us. In general, the fewer the constraints and conditions that are built into the database, the faster it is for MySQL to work with. However, MySQL now optimizes for NOT NULL columns, so it is better to declare NOT NULL where the data will never be NULL. See the "Data Size" section of the MySQL manual for details.

Anonymous  Jan 19, 2011 
Printed
Page 214
code excerpt at top of page

This error includes book's accompanying code. The book code excerpt has "time TIME" and says that this is preferred to the alternate DECIMAL type. However, the code has "time DECIMAL(5,2)" in file "data/music.sql". Elsewhere in the book it's clear from table outputs that the decimal type was used; errata on book website has changes this to DECIMAL(3,2). However, page 214 describes TIME as the preferred type. There should be consistency between the type used in the code, the table outputs, and the discussion on this page.

Note from the Author or Editor:
DECIMAL(5,2) is the choice used for the book; the errata actually correct to use this, not DECIMAL(3,2).

Anonymous  Jan 14, 2009 
Printed
Page 225
Upper

mysql> SELECT CONCAT(artist_name, " recorded ", album_name) AS recording
-> FROM artist INNER JOIN album USING (artist_id)
-> ORDER BY CONCAT(artist_name, " recorded ", album_name);

Should be:

mysql> SELECT CONCAT(artist_name, " recorded ", album_name)
-> FROM artist INNER JOIN album USING (artist_id)
-> ORDER BY CONCAT(artist_name, " recorded ", album_name);

Anonymous  Jan 19, 2011 
Printed
Page 233
Middle

mysql> SELECT * FROM track GROUP BY artist_id;
+----------+----------------------+-----------+----------+----------+
| track_id | track_name | artist_id | album_id | time |
+----------+----------------------+-----------+----------+----------+
| 0 | Elegia | 1 | 1 | 00:04:56 |
| 0 | Do You Love Me? | 2 | 1 | 00:05:57 |
| 0 | In A Silent Way | 3 | 1 | 00:01:49 |
| 0 | Rocks Off | 4 | 1 | 00:04:32 |
| 0 | Breaking Into Heaven | 5 | 1 | 00:11:22 |
| 0 | Spinning Around | 6 | 1 | 00:03:28 |
+----------+----------------------+-----------+----------+----------+
6 rows in set (0.12 sec)

Only the artist_id here is meaningful--the rest just contain the first-listed entry from each group. To illustrate this point, "Elegia" is the first track that would be listed for artist_id 1 if we hadn't performed any grouping:

mysql> SELECT * FROM track WHERE artist_id=1;
+----------+----------------------+-----------+----------+----------+
| track_id | track_name | artist_id | album_id | time |
+----------+----------------------+-----------+----------+----------+
| 0 | Elegia | 1 | 1 | 00:04:56 |
| 1 | In A Lonely Place | 1 | 1 | 00:06:16 |
| 2 | Procession | 1 | 1 | 00:04:28 |
...
+----------+----------------------+-----------+----------+----------+
86 rows in set (0.01 sec)


Should be:



mysql> SELECT * FROM track GROUP BY artist_id;
+----------+----------------------+-----------+----------+-------+
| track_id | track_name | artist_id | album_id | time |
+----------+----------------------+-----------+----------+-------+
| 0 | Elegia | 1 | 1 | 4.93 |
| 0 | Do You Love Me? | 2 | 1 | 5.95 |
| 0 | In A Silent Way | 3 | 1 | 1.81 |
| 0 | Rocks Off | 4 | 1 | 4.54 |
| 0 | Breaking Into Heaven | 5 | 1 | 11.37 |
| 0 | Spinning Around | 6 | 1 | 3.46 |
+----------+----------------------+-----------+----------+-------+
6 rows in set (0.00 sec)

Only the artist_id here is meaningful--the rest just contain the first-listed entry from each group. To illustrate this point, "Elegia" is the first track that would be listed for artist_id 1 if we hadn't performed any grouping:

mysql> SELECT * FROM track WHERE artist_id=1;
+----------+-----------------------+-----------+----------+------+
| track_id | track_name | artist_id | album_id | time |
+----------+-----------------------+-----------+----------+------+
| 0 | Elegia | 1 | 1 | 4.93 |
| 1 | In A Lonely Place | 1 | 1 | 6.26 |
| 2 | Procession | 1 | 1 | 4.47 |
...
+----------+-----------------------+-----------+----------+------+
86 rows in set (0.00 sec)

Anonymous  Jan 19, 2011 
Printed
Page 234
first paragraph after heading "The HAVING Clause", second sentence

change "to use it find" to "to use it to find"

Anonymous  Jan 14, 2009 
Printed
Page 239
top of page

Check font for ?6 x 13?.

Anonymous   
Printed
Page 239
top of page

Check font for "6 x 13".

Anonymous   
248
last paragraph

error in both safari and print:

look for "rollRIGHT JOIN" in paragraph, change this to "RIGHT JOIN"

Anonymous  Jan 14, 2009 
Printed
Page 248
Spacing is off in top table.

Anonymous   
Printed
Page 248
Spacing is off in top table.

Anonymous   
Printed
Page 248
Upper

COUNT(*) should be COUNT(played)


mysql> SELECT artist_name, album_name, COUNT(*) FROM
-> artist INNER JOIN album USING (artist_id)
-> INNER JOIN track USING (artist_id, album_id)
-> LEFT JOIN played USING (artist_id, album_id, track_id)
-> GROUP BY album.artist_id, album.album_id;

Should be:

mysql> SELECT artist_name, album_name, COUNT(played) FROM
-> artist INNER JOIN album USING (artist_id)
-> INNER JOIN track USING (artist_id, album_id)
-> LEFT JOIN played USING (artist_id, album_id, track_id)
-> GROUP BY album.artist_id, album.album_id;

Anonymous  Jan 19, 2011 
Printed
Page 252
first sentence

Remove parentheses from sentence.

Anonymous   
Printed
Page 252
first sentence

Remove parentheses from sentence.

Note from the Author or Editor:
(In "User Variables," later in this chapter, we'll show how you can use variables to avoid having to type in the value in the second query.)

Should be:

In "User Variables," later in this chapter, we'll show how you can use variables to avoid having to type in the value in the second query.

Anonymous   
Printed
Page 255
Lower

(Boolean OR), the ANY keyword returns values

Should be:

(Boolean OR), the ALL keyword returns values

Anonymous  Jan 19, 2011 
262
code excerpt at top of page

The SQL query example at top of page should be better chosen. While technically correct the chosen example is redundant and should be replaced with something more meaningful. In this case it makes no sense to use the FROM clause, since the parenthetical statement gives the same result. In other words, running:

mysql> SELECT producer_name, months FROM
-> (SELECT producer_name, years*12 AS months FROM producer) AS prod;

is equivalent to running:

SELECT producer_name, years*12 AS months FROM producer

Anonymous  Jan 15, 2009 
Printed
Page 262
Middle

The outer query is straightforward: it just returns the producer_name and the month value created through the subquery.

Should be:

The outer query here is very simple and just picks up the producer_name and the month value created through the subquery.

Anonymous  Jan 19, 2011 
Printed
Page 268 and 269
Align the plus signs in the tables with the lines beneath. Also do this on 296, 325, 388, 390, 391.

Anonymous   
Printed
Page 268, 269, 296, 325, 388, 390, 391
Tables

Align the plus signs in the tables with the lines beneath.

Anonymous   
Printed
Page 284
top of page

Remove ? from around ':'.

Anonymous   
Printed
Page 284
bottom of page

Make ?c:? uppercase.

Anonymous   
Printed
Page 284
top of page

Remove ' from around ':'.

Anonymous   
Printed
Page 284
bottom of page

Make "c:" uppercase.

Note from the Author or Editor:
c:\artists_and_albums.csv

Should be:

C:\artists_and_albums.csv

Anonymous   
Printed
Page 302
Check font on ?the_password?

Anonymous   
Printed
Page 302

Check font on "the_password"

Anonymous   
Printed
Page 311
Middle

yazd.invy.com

Should be:

yazd.invyhome.com

Anonymous  Jan 19, 2011 
Printed
Page 320
First paragraph, line 3

...of access the user partmusic has for the database ResearchPeople.
should be:
...of access the user partmusic has for the database music.

Anonymous   
Printed
Page 320
First paragraph, line 3

...of access the user partmusic has for the database ResearchPeople.
should be:
...of access the user partmusic has for the database music.

Anonymous   
Printed
Page 331
Check font on the_mysql_root_password?.

Anonymous   
Printed
Page 349
?set password? and ?password? should be uppercase in examples.

Anonymous   
Printed
Page 349
Middle

"set password" and "password" should be uppercase in examples.

Note from the Author or Editor:
mysql> set password for 'root'@'localhost'=password('the_new_mysql_root_password');

Should be:

mysql> SET PASSWORD FOR 'root'@'localhost'=PASSWORD('the_new_mysql_root_password');

Anonymous   
Printed
Page 356
Lower

INSERT INTO `track` VALUES (0,'Do You Love Me?',2,1,'00:05:57'),
(1,'Nobody\'s Baby Now',2,1,'00:03:52'),(2,'Loverman',2,1,'00:06:22'),
(3,'Jangling Jack',2,1,'00:02:47'),(4,'Red Right Hand',2,1,'00:06:11'),
(5,'I Let Love In',2,1,'00:04:15'),(6,'Thirsty Dog',2,1,'00:03:49'),
...
UNLOCK TABLES;


Should be:


INSERT INTO `track` VALUES (0,'Do You Love Me?',2,1,'5.95'),
(1,'Nobody\'s Baby Now',2,1,'3.87'),(2,'Loverman',2,1,'6.37'),
(3,'Jangling Jack',2,1,'2.78'),(4,'Red Right Hand',2,1,'6.18'),
(5,'I Let Love In',2,1,'4.25'),(6,'Thirsty Dog',2,1,'3.81'),
...
UNLOCK TABLES;

Anonymous  Jan 19, 2011 
Printed
Page 358
?set-charset? shouldn't be italicized.

Anonymous   
Printed
Page 358
Lower (penultimate line)

"set-charset" shouldn't be italicized.

Anonymous   
Printed, PDF, ePub, Mobi, , Other Digital Version
Page 362
Fourth code block

Doesn't work on Linux Ubuntu:

`date +"%Y.%m.%d.%H.%M"`.MySQL_Backup.sql.gz

Needs to be:
`/bin/date +\%Y.\%m.\%d.\%H.\%M`.MySQL_Backup.sql.gz

Note from the Author or Editor:
45 4 * * sun /usr/local/mysql/bin/mysqldump \
--user=root \
--password=the_mysql_root_password \
database_to_dump \
| gzip --best --to-stdout \
> dump_directory/`date +"%Y.%m.%d.%H.%M"`.MySQL_Backup.sql.gz

Should be changed to:

45 4 * * sun /usr/local/mysql/bin/mysqldump user=root --password=the_mysql_root_password database_to_dump | gzip --best --to-stdout > /tmp/`/bin/date +"\%Y.\%m.\%d.\%H.\%M"`.MySQL_Backup.sql.gz

Chris Piekarski  Aug 28, 2012 
Printed
Page 363
top of page

Check font for ?crontab -1.?

Anonymous   
Printed
Page 363
top of page

Check font for "crontab -1."

Note from the Author or Editor:
crontab -l (the "l" stands for "list", so make sure this is an L not a One.)

Anonymous   
Printed
Page 363

In the Run tab, type in the full command above.

Should be:

In the Run tab, type in the full command below.

Anonymous  Jan 19, 2011 
Printed
Page 390
?status? should be in user input font.

Anonymous   
Printed
Page 390

"status" should be in user input font.

Note from the Author or Editor:
Status should be bold monospace in this line:

$ mysqladmin --user=root --password=the_mysql_root_password status

Anonymous   
Printed
Page 391
Fragment in last sentence should be set off by em-dashes, not parentheses.

Anonymous   
Printed
Page 391
Fragment in last sentence

Fragment in last sentence should be set off by em-dashes, not parentheses.

Note from the Author or Editor:
connection (see how the new process number (26535) is different?):

Should read:

connection (see how the new process number - 26535 - is different?):

Anonymous   
395
1st paragraph, 1st sentence

(Both in printed version and online.)

"wePHPMyb" makes no sense.

Note from the Author or Editor:
MySQL's most common use is in wePHPMyb database applications.

Should read:

MySQL's most common use is in web database applications.

Anonymous  Jan 30, 2009 
Printed
Page 409
code sample at top of page

change:

while($row = @ mysql_fetch_array($result))

to:

while($row = @ mysql_fetch_array($result, MYSQL_ASSOC))

(add the missing MYSQL_ASSOC) as is shown in the full code on p. 406

Anonymous  Jan 30, 2009 
Printed
Page 436
Middle

There's an unencoded < in this line (&lt; is showing, when it should be <).


for ($x=0;$x&lt;$count;$x++)

Should be:

for ($x=0;$x<$count;$x++)

Anonymous  Jan 19, 2011 
Printed
Page 456
Lower

There's an extra ampersand in this line.

for($x=0; $x&<$len; $x++)

Should be:

for($x=0; $x<$len; $x++)

Anonymous  Jan 19, 2011 
Printed
Page 463
code sample at top of page

Change the word "wedding" to "music" in this sentence:

// Connect to the MySQL DBMS and use the wedding database - credentials are in the file db.php

It should read:

// Connect to the MySQL DBMS and use the music database - credentials are in the file db.php

Anonymous  Jan 30, 2009 
Printed
Page 475
Move the second line of the last example up to the first line.

?About the Authors?: Change ?England? to ?Britain? and ?between civilizations? to ?among civilizations.?

Anonymous   
Printed
Page 475

"About the Authors": Change "England" to "Britain" and "between civilizations" to "among civilizations."

Anonymous   
Printed
Page 502
Lower

There's an extra closing bracket, which should be removed.



{
// The user wants to add a new item to their shopping list.
...

}
}


Should be:


{
// The user wants to add a new item to their shopping list.
...
}

Anonymous  Jan 19, 2011 
Printed
Page 506
Lower (last line)

// Try to unreserve the gift with the matching username and gift ID
$query = "UPDATE gifts SET username = NULL WHERE gift_id = {$gift_id}".
"AND username={$_SESSION['username']}";

Should be:

// Try to unreserve the gift with the matching username and gift ID
$query = "UPDATE gifts SET username = NULL WHERE gift_id = {$gift_id}".
" AND username='{$_SESSION['username']}'";

Anonymous  Jan 19, 2011 
Printed
Page 514
4th paragraph

The code:
print "\nThe temperature difference is: ".
$TemperatureToday-$TemperatureYesterday . "\n";
should be:
print "\nThe temperature difference is: ".
($TemperatureToday-$TemperatureYesterday) . "\n";
Otherwise we cannot get correct output.

Peter Pan  Jan 11, 2010 
Printed
Page 542
2nd example on page

The line:
while(my $val=$sth->fetchrow_hashref())

Should read:
while(my $val=$ref->fetchrow_hashref())
^^^^

Note from the Author or Editor:
while(my $val=$sth->fetchrow_hashref())
{
printf ("%-5s %-128s\n", $ref->{artist_id}, $ref->{artist_name});
}

near the top of the page should be corrected to:

while(my $ref=$sth->fetchrow_hashref())
{
printf ("%-5s %-128s\n", $ref->{artist_id}, $ref->{artist_name});
}

Chuck Howell  Jul 28, 2009 
Printed
Page 549
Example 17-3

In the while statement in Example 17-4, it should be
$Total += $ref -> [1]

Note from the Author or Editor:
page 549, Example 17.3; the line:

$Total+=$ref->[0];

should be:

$Total+=$ref->[1];

Anonymous  Nov 19, 2010 
Printed
Page 579
Upper

for($matchedrows=0;($row = @ mysqli_fetch_array($result));$matchedrows++);

Should be:

for($matchedrows=0;($tmprow = @ mysqli_fetch_array($result));$matchedrows++) $row=$tmprow;

Anonymous  Jan 19, 2011 
Printed
Page 583
Symbols section of index

All the symbols seem to be Perl and PHP operators. Why aren't SQL operators listed? Or maybe there is a worse problem: I can't find a list of SQL operators in the book.

Note from the Author or Editor:
The index should be improved in any future edition.

Anonymous