100% found this document useful (1 vote)
7 views

Download (Ebook) Getting Started with MariaDB, 2nd Edition: Explore the powerful features of MariaDB with practical examples by Daniel Bartholomew ISBN 9781785284120, 1785284126 ebook All Chapters PDF

The document promotes various ebooks available for download, including 'Getting Started with MariaDB, 2nd Edition' by Daniel Bartholomew. It provides links to download the full version and explore additional ebooks on the website ebooknice.com. The document also includes details about the author and the contents of the MariaDB book, which covers installation, configuration, security, administration, and data management.

Uploaded by

nelithwakasa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
7 views

Download (Ebook) Getting Started with MariaDB, 2nd Edition: Explore the powerful features of MariaDB with practical examples by Daniel Bartholomew ISBN 9781785284120, 1785284126 ebook All Chapters PDF

The document promotes various ebooks available for download, including 'Getting Started with MariaDB, 2nd Edition' by Daniel Bartholomew. It provides links to download the full version and explore additional ebooks on the website ebooknice.com. The document also includes details about the author and the contents of the MariaDB book, which covers installation, configuration, security, administration, and data management.

Uploaded by

nelithwakasa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

Visit https://ebooknice.

com to download the full version and


explore more ebooks

(Ebook) Getting Started with MariaDB, 2nd Edition:


Explore the powerful features of MariaDB with
practical examples by Daniel Bartholomew ISBN
9781785284120, 1785284126
_____ Click the link below to download _____
https://ebooknice.com/product/getting-started-with-
mariadb-2nd-edition-explore-the-powerful-features-of-
mariadb-with-practical-examples-5475706

Explore and download more ebooks at ebooknice.com


Here are some recommended products that might interest you.
You can download now and explore!

(Ebook) Getting Started with MariaDB by Bartholomew, Daniel ISBN


9781782168096, 1782168095

https://ebooknice.com/product/getting-started-with-mariadb-34399024

ebooknice.com

(Ebook) MariaDB cookbook by Daniel Bartholomew ISBN 9781783284399,


9781783284405, 1783284390, 1783284404

https://ebooknice.com/product/mariadb-cookbook-5294638

ebooknice.com

(Ebook) Getting Started with Meteor.js JavaScript Framework, 2nd


Edition: Learn to develop powerful web applications in minutes with
Meteor by Isaac Strack ISBN 9781785285547, 1785285548

https://ebooknice.com/product/getting-started-with-meteor-js-
javascript-framework-2nd-edition-learn-to-develop-powerful-web-
applications-in-minutes-with-meteor-5475694
ebooknice.com

(Ebook) Programming The Raspberry Pi - Getting Started With Python,


2nd Edition by Simon Monk ISBN B015K0URT8

https://ebooknice.com/product/programming-the-raspberry-pi-getting-
started-with-python-2nd-edition-55324462

ebooknice.com
(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason; Viles, James
ISBN 9781459699816, 9781743365571, 9781925268492, 1459699815,
1743365578, 1925268497

https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

ebooknice.com

(Ebook) Getting Started with Visual Studio 2019: Learning and


Implementing New Features by Dirk Strauss ISBN 9781484254486,
9781484254493, 1484254481, 148425449X

https://ebooknice.com/product/getting-started-with-visual-
studio-2019-learning-and-implementing-new-features-24051846

ebooknice.com

(Ebook) Cambridge IGCSE and O Level History Workbook 2C - Depth Study:


the United States, 1919-41 2nd Edition by Benjamin Harrison ISBN
9781398375147, 9781398375048, 1398375144, 1398375047

https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044

ebooknice.com

(Ebook) Getting Started with Gulp - Second Edition by Travis Maynard


ISBN 9781787283732, 1787283739

https://ebooknice.com/product/getting-started-with-gulp-second-
edition-6855920

ebooknice.com

(Ebook) Getting Started With Angular by Stephen Adams

https://ebooknice.com/product/getting-started-with-angular-22526942

ebooknice.com
www.it-ebooks.info
Getting Started with MariaDB
Second Edition

Explore the powerful features of MariaDB with


practical examples

Daniel Bartholomew

BIRMINGHAM - MUMBAI

www.it-ebooks.info
Getting Started with MariaDB
Second Edition

Copyright © 2015 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: June 2015

Production reference: 1120615

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham B3 2PB, UK.

ISBN 978-1-78528-412-0

www.packtpub.com

www.it-ebooks.info
Credits

Author Project Coordinator


Daniel Bartholomew Nidhi Joshi

Reviewers Proofreader
David Chanial Safis Editing
Emilien Kenler
Giacomo Picchiarelli Indexer
Monica Ajmera Mehta

Commissioning Editor
Kartikey Pandey Production Coordinator
Arvindkumar Gupta

Acquisition Editor
Usha Iyer Cover Work
Arvindkumar Gupta

Content Development Editor


Siddhesh Salvi

Technical Editor
Shashank Desai

Copy Editors
Sarang Chari
Sonia Mathur

www.it-ebooks.info
About the Author

Daniel Bartholomew has been using Linux since 1997 and databases since 1998.
In addition to this book, he has also written MariaDB Cookbook, Packt Publishing,
and dozens of articles for various magazines, including The Linux Journal, Linux
Pro, Ubuntu User, and Tux. He became involved with the MariaDB project shortly
after it began in early 2009 and continues to be involved to this day. He currently
works for MariaDB, Inc. and splits his time between managing MariaDB releases,
documentation, and maintaining various bits and pieces that keep the MariaDB
project running smoothly.

www.it-ebooks.info
About the Reviewers

David Chanial is a French autodidactic system administrator and programmer.


He has been setting up high-availability hosting solutions for years, especially using
Gentoo Linux, Apache/Nginx, PHP, MariaDB/MySQL, and Python/Perl/C.

Having sold the French company Euro Web (hosting, dedicated servers, managed
services, and consulting) in 2011, which he cofounded and managed on a technical
level from 2003, he spent some time working as a consultant and a system/API
developer through his company, DaviXX.

Since 2013–2014, in addition to working independently through his company on


projects using Ansible, MariaDB, Django, and embedded electronics and reviewing
books such as MariaDB High Performance, Packt Publishing, David held the position
of a system administrator and network director at Believe Digital Group, managing
database issues (big data), network infrastructure, and homemade storage solutions.

www.it-ebooks.info
Emilien Kenler, after working on small web projects, began focusing on game
development in 2008 while he was in high school. Until 2011, he worked for different
groups and specialized in system administration.

In 2011, while studying computer science engineering, he founded a company


that sold Minecraft servers. He created a lightweight IaaS (https://github.com/
HostYourCreeper/) based on new technologies, such as Node.js and RabbitMQ.

Thereafter, he worked at TaDaweb as a system administrator, building its


infrastructure and creating tools to manage deployments and monitoring.

In 2014, he began a new adventure at Wizcorp, Tokyo. In 2014, Emilien graduated


from the University of Technology of Compiègne, France.

Emilien has also contributed as a reviewer on Learning Nagios 4, MariaDB High


Performance, OpenVZ Essentials, and Vagrant Virtual Development Environment
Cookbook, all books by Packt Publishing.

Giacomo Picchiarelli is a test and software engineer with 6 years of experience


in designing data-driven applications and MySQL administration. He has a strong
background in Linux systems and test-driven development.

www.it-ebooks.info
www.PacktPub.com

Support files, eBooks, discount offers, and more


For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.com
and as a print book customer, you are entitled to a discount on the eBook copy. Get in
touch with us at service@packtpub.com for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
TM

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser

Free access for Packt account holders


If you have an account with Packt at www.PacktPub.com, you can use this to access
PacktLib today and view 9 entirely free books. Simply use your login credentials for
immediate access.

www.it-ebooks.info
www.it-ebooks.info
Table of Contents
Preface v
Chapter 1: Installing MariaDB 1
Choosing a MariaDB series 3
The development series 3
The stable series 3
The maintenance series 4
Installing MariaDB on Windows 4
Installing MariaDB on Mac OS X 8
Installing MariaDB on Debian, Ubuntu, and Linux Mint 9
Installing MariaDB on Fedora, Red Hat, and CentOS 11
Installing MariaDB on other Linux distributions 14
MariaDB package security 14
After the installation 15
Troubleshooting installation issues 16
Summary 17
Chapter 2: Configuring MariaDB 19
The MariaDB filesystem layout 19
The MariaDB filesystem layout on Windows 19
The MariaDB filesystem layout on Linux 20
Modular configuration on Linux 22
The anatomy of the MariaDB configuration file 23
Where is my configuration file? 23
Comments 24
Groups 24
Options that do not require values 25
Options that require values 26
Option formatting 26
Options, options everywhere 27

[i]

www.it-ebooks.info
Table of Contents

Activating configuration changes 28


Summary 29
Chapter 3: Securing MariaDB 31
Security layers 32
Securing MariaDB in 10 seconds 33
Connecting safely 36
Connecting safely on the command line 36
Connecting safely in scripts 36
Server security 38
Building security 38
Internal network security 39
Internet security 40
Summary 41
Chapter 4: Administering MariaDB 43
User privileges 43
Global administrative user privileges 44
Database, table, and column user privileges 44
Miscellaneous user privileges and limits 45
Creating users 46
Granting, revoking, and showing permissions 48
Granting permissions 48
Revoking permissions 49
Showing permissions 50
Setting and changing passwords 51
Removing users 51
Summary 52
Chapter 5: Using MariaDB – Databases and Tables 53
The mysql command-line client application 53
Connecting to MariaDB 54
Using USE to select a database 55
Using SHOW to list all databases on a server 56
Creating and deleting databases 57
Using CREATE DATABASE to create a database 58
Using DROP DATABASE to delete a database 58
Data, tables, and normalization 59
Creating, altering, and dropping tables 61
Using CREATE TABLE 61
Using CREATE TABLE – datatypes 62
Using CREATE TABLE– other options 63
Using CREATE TABLE – an example 63

[ ii ]

www.it-ebooks.info
Table of Contents

Using SHOW to display the command used to create a table 64


Using DESCRIBE to explore the structure of a table 65
Using ALTER TABLE 66
Using ALTER TABLE – basic syntax 66
Using ALTER TABLE – adding a column 67
Using ALTER TABLE – modifying a column 67
Using ALTER TABLE – dropping a column 67
Using DROP TABLE 68
Summary 69
Chapter 6: Using MariaDB – Inserting, Updating, and Deleting 71
Using INSERT 71
Inserting complete rows 72
Inserting partial rows 73
Inserting from another table 74
Inserting from a file 74
Using UPDATE 75
Using DELETE 77
Summary 78
Chapter 7: Using MariaDB – Retrieving Data 79
Retrieving data 79
Retrieving everything 80
Retrieving selected columns 81
Filtering and searching data 81
Filtering by exact values 82
Using logical operators 83
Using the AND operator 83
Using the OR operator 83
Evaluation order 84
Using the IN operator 85
Using the NOT operator 86
Searching with LIKE 86
Sorting data 87
Joining data 88
Summarizing data 90
The AVG function 90
The COUNT function 91
The MIN and MAX functions 91
The SUM function 92
Using GROUP BY with summarized data 93
Using HAVING to filter GROUP BY 94
Summary 95

[ iii ]

www.it-ebooks.info
Table of Contents

Chapter 8: Maintaining MariaDB 97


MariaDB log files 97
The binary log 97
The error log 98
The general query log 99
The slow query log 100
Optimizing and tuning MariaDB 101
Backing up, importing, and restoring data 102
Basic backups with mysqldump 102
Restoring backups made with mysqldump 102
Making tab-delimited backups with mysqldump 103
Restoring and importing data with mysqlimport 104
Making backups of MyISAM tables with mysqlhotcopy 104
Making backups of XtraDB and InnoDB tables with xtrabackup 105
Restoring backups made with xtrabackup 106
Making cold backups 107
Repairing MariaDB 107
Checking and optimizing tables with mysqlcheck 107
Repairing tables 108
Summary 109
Appendix: MariaDB Next Steps 111
Index 113

[ iv ]

www.it-ebooks.info
Preface
Databases are all around us. Almost every website we visit and nearly every store we
shop at has a database (or several) working quietly behind the scenes. The same goes
for banks, hospitals, government agencies, theaters, doctors, hospitals, amusement
parks, and police departments. All use databases to store, sort, and analyze their own
particular information.

This information comes in many forms and can be anything that can be stored
electronically inside a computer. This includes books, catalogs, addresses, names,
dates, finances, pictures, money, passwords, documents, preferences, tweets, posts,
likes, blogs, articles, and much more. Databases are one of the foundational pillars
of the modern electronic world.

Your posts on Facebook and tweets on Twitter are stored in a database. All your
financial information in your bank is stored in a database. Your purchase history at
your favorite online retailer is too. How about your progress in your favorite online
game? You guessed it. What about the record of when you last paid your water bill?
That too! You just can't get away from databases. They are, quite literally, everywhere.

There is a new database that has caught the attention of the database community over
the past few years like few others have. First released in 2009, its name is MariaDB—
named after the youngest daughter of its creator, Michael "Monty" Widenius.

MariaDB may be younger than the databases it is often compared with, but it has a
stellar parentage. It's a next-generation evolution of the popular MySQL database,
also created by Monty (you may have heard of it, but don't worry if you haven't).

MariaDB is open source. This means that the source code is freely downloadable
and is governed by a license that helps ensure the source code stays free and open
to all. The MariaDB developers have also kindly provided installers for various
operating systems.

[v]

www.it-ebooks.info
Preface

Since its first release, MariaDB has gained a large, loyal following faster than almost
any other database. Today, it powers tens of thousands of websites, big and small,
and is the database of choice for many companies in a wide variety of industries
around the world with hundreds of thousands of users.

The great news is that we can install and use it ourselves, right now, on our personal
laptop and desktop computers. For all of its power—and MariaDB is a very powerful
and capable database, make no mistake—it is very easy to install and use.

This book provides an introduction to MariaDB that is enough to get us started.


Don't worry if you've never used a database before - this book covers everything you
need to know, and before you know it, you'll be on your way to becoming an expert
database administrator (DBA). But even if you never move beyond just tinkering
or playing around with MariaDB, you'll learn about one of the fundamental
technologies of our times.

Not a bad accomplishment over a weekend or two.

What this book covers


Chapter 1, Installing MariaDB, explains how to install MariaDB on Windows, Linux,
and Mac OS X.

Chapter 2, Configuring MariaDB, explains the basics of configuring MariaDB, including


the location of the configuration files and how to set common configuration options.

Chapter 3, Securing MariaDB, provides an overview of the best practices for MariaDB
security, including how to easily secure a new MariaDB installation.

Chapter 4, Administering MariaDB, explains how to add and administer MariaDB


user accounts.

Chapter 5, Using MariaDB – Databases and Tables, covers the commands used to create,
update, and delete databases and tables.

Chapter 6, Using MariaDB – Inserting, Updating, and Deleting, covers the commands
used to add, update, and delete data from our database tables.

Chapter 7, Using MariaDB – Retrieving Data, covers the commands used to retrieve
data from our database tables, including filtering, searching, sorting, joining, and
summarizing the data.

[ vi ]

www.it-ebooks.info
Preface

Chapter 8, Maintaining MariaDB, explains how to maintain your MariaDB database


and keep it running smoothly.

Appendix, MariaDB Next Steps, provides you with a list of various online resources
available to help you on your way to becoming a MariaDB expert.

What you need for this book


To get the most out of this book, you will need a computer with Windows,
any version from XP to Windows 8 would do; Mac OS X; or one of the Linux
distributions: Ubuntu, Debian, Fedora, CentOS, or Red Hat. MariaDB runs on
many more operating systems and distributions, but these are the ones that are
specifically mentioned and discussed in this book.

To install MariaDB, you will need an Internet connection and the necessary
administrative rights to install software.

To edit MariaDB configuration files, you will need a text editor. Notepad is a good
universal choice on Windows. TextEdit and TextWrangler work well on Mac OS X.
There are many excellent text editors on Linux, just pick a favorite: Vim, gedit, nano,
pluma, and emacs are all good choices. A word processor, such as Word, Wordpad,
OpenOffice, Pages, or LibreOffice, will not work.

No other software is required.

Who this book is for


This book is for anyone who wants to learn more about databases in general,
and/or MariaDB in particular. To get the most out of this book, you only need to
be comfortable installing software on your computer, editing files with a text editor,
and using the command line and terminal. Prior database experience is not required.

Conventions
In this book, you will find a number of text styles that distinguish between different
kinds of information. Here are some examples of these styles and an explanation of
their meaning.

Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "As
mentioned previously, the ZIP files are similar to the Linux binary .tar.gz files and
they are only recommended for those who know that they want it."

[ vii ]

www.it-ebooks.info
Preface

A block of code is set as follows:


CREATE TABLE employees (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
surname VARCHAR(100),
givenname VARCHAR(100),
pref_name VARCHAR(50),
birthday DATE COMMENT 'approximate birthday OK'
);

Any command-line input or output is written as follows:


brew doctor

New terms and important words are shown in bold. Words that you see on the
screen, for example, in menus or dialog boxes, appear in the text like this: "The
Install as service box is checked by default, and it is recommended to keep it that
way so that MariaDB starts up when the computer is booted."

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.

Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or disliked. Reader feedback is important for us as it helps
us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail feedback@packtpub.com, and mention


the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.

[ viii ]

www.it-ebooks.info
Preface

Downloading the example code


You can download the example code files from your account at http://www.
packtpub.com for all the Packt Publishing books you have purchased. If you
purchased this book elsewhere, you can visit http://www.packtpub.com/support
and register to have the files e-mailed directly to you.

Errata
Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you find a mistake in one of our books—maybe a mistake in the text or
the code—we would be grateful if you could report this to us. By doing so, you can
save other readers from frustration and help us improve subsequent versions of this
book. If you find any errata, please report them by visiting http://www.packtpub.
com/submit-errata, selecting your book, clicking on the Errata Submission Form
link, and entering the details of your errata. Once your errata are verified, your
submission will be accepted and the errata will be uploaded to our website or added
to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/


content/support and enter the name of the book in the search field. The required
information will appear under the Errata section.

Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all
media. At Packt, we take the protection of our copyright and licenses very seriously.
If you come across any illegal copies of our works in any form on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.

Please contact us at copyright@packtpub.com with a link to the suspected


pirated material.

We appreciate your help in protecting our authors and our ability to bring you
valuable content.

Questions
If you have a problem with any aspect of this book, you can contact us at
questions@packtpub.com, and we will do our best to address the problem.

[ ix ]

www.it-ebooks.info
www.it-ebooks.info
Installing MariaDB
Before we can start using MariaDB, we have to install it. The MariaDB source
code can be compiled to run on a wide variety of different platforms and system
architectures, but there are pre-compiled packages available for Windows and Linux,
which make the process easier.

In addition to the source code, there are several other package types, such as:

• Windows MSI packages


• Linux YUM packages
• Linux APT packages
• Linux and Windows binaries

The Windows MSI packages are for computers and servers running from Windows
XP to Windows 8. The Linux .rpm packages are used with distributions such as
Fedora, CentOS, and Red Hat that use the Yellow Dog Updater modified (YUM)
package manager. Linux .deb packages are used with distributions such as Debian
and Ubuntu, which use the Advanced Packaging Tool (APT) package manager. We
will cover how to install all these types in this chapter.

We will cover the fourth type, the Linux and Windows binaries, only briefly. These
packages are mainly useful to experienced users of MariaDB who have non-standard
custom setups on their database servers. The Windows binaries come in a ZIP file
(.zip) and the Linux binaries in a gzipped tar file (.tar.gz), sometimes called a
binary tarball.

[1]

www.it-ebooks.info
Installing MariaDB

Even though the MariaDB binaries are recommended for more experienced users,
installing them is not especially difficult. Check the following links for the official
instructions to install the Linux and Windows binary packages, respectively:

• https://mariadb.com/kb/en/installing-mariadb-binary-tarballs
• https://mariadb.com/kb/en/installing-mariadb-windows-zip-
packages

We will also cover how to install MariaDB on Mac OS X. Packages for this operating
system supplied by a third party, not by the MariaDB developers.

The choice of which MariaDB package to install is an easy one—just use whichever
one is appropriate for your system. If you are using Windows, use the MSI package,
for Ubuntu or Debian, use the APT packages, and for Red Hat, Fedora, or CentOS,
use the YUM packages.

The rest of this chapter contains instructions for each type but before we get to that,
we need to talk about series. And no, it has nothing to do with baseball, but it does
lend itself to a baseball analogy.

So in short, the topics of the remaining sections in this chapter are as follows:

• Choosing a MariaDB series


• Installing MariaDB on Windows
• Installing MariaDB on Mac OS X
• Installing MariaDB on Debian, Ubuntu, and Linux Mint
• Installing MariaDB on Fedora, Red Hat, and CentOS
• Installing MariaDB on other Linux distributions
• MariaDB package security
• After the installation
• Troubleshooting installation issues

Feel free to jump around and only read the sections that directly pertain to you and
your chosen operating system.

[2]

www.it-ebooks.info
Chapter 1

Choosing a MariaDB series


The development of MariaDB proceeds along multiple development tracks, called
series. There is a stable series and several maintenance series. Often, there is also
a development series. This is similar to the Debian GNU/Linux practice of having
stable, testing, and unstable versions.

The development series


The development series of MariaDB is where the major new features and capabilities
are introduced. Think of this like minor league baseball where the upcoming future
stars are introduced and are improved and honed to perfection. At any given time,
the quality of the current development release could range from Alpha (which has
no guarantees that it will even work reliably) to Beta (which is feature-complete but
generally needs a lot of bug fixing and testing) to Release Candidate (which is ready
for general use except for some additional testing and minor bug fixing).

During the development cycle, there will generally be several Alpha releases, where
new features are introduced, followed by a couple of Beta releases where the code is
refined and polished, followed by one or two Release Candidate releases where the
final fixes and polishing take place. The final step for any development series is when
it is declared stable and moves into the major league stable series.

If the current development series release of MariaDB is a


Release Candidate, we may want to choose that over the
current stable release. Otherwise, it is generally best to stick
with whatever the current stable release is.

The stable series


For most users just starting out, whatever series is marked stable is the one to
use. This is the major league series, the best and most complete version currently
available. After a development series has reached a sufficient level of quality to
be considered stable, it is promoted to this series and becomes the recommended
version of MariaDB.

After being marked as stable, the MariaDB Foundation has a policy that the series
will be well supported with bug and security fixes for a period of at least 5 years.
This is regardless of whether it is the current stable series or if it is one of the
maintenance series. It all depends on when it first becomes stable.

[3]

www.it-ebooks.info
Installing MariaDB

The maintenance series


When a series moves from development to stable, the series that was the current
stable one is moved to become a maintenance series. This means that it will still
receive bug fixes for the rest of its 5-year maintenance period but it is no longer the
recommended or preferred release of MariaDB. Think of it as the hall of fame—full
of great previous releases of MariaDB, which while still excellent, have been replaced
by a new generation. At any given time, there may be three, four, or more MariaDB
major versions in the maintenance series.

Most Linux distributions include MariaDB in their package repositories,


either as the default MySQL-compatible database, or as an alternative
choice. The version of MariaDB that they include is up to them, and
while it is sometimes the most recent stable version of MariaDB, it is
often one of the more recent major versions in the maintenance series.

We'll now go through the installation of MariaDB for each of the major operating
systems. First Windows, then Mac OS X, then Debian GNU/Linux and Ubuntu Linux,
followed by Fedora, Red Hat, and CentOS Linux, and lastly, other Linux distributions.

Installing MariaDB on Windows


There are two types of MariaDB downloads for Windows: ZIP files and MSI
packages. As mentioned previously, the ZIP files are similar to the Linux binary
.tar.gz files and they are only recommended for those who know that they want it.

If we are starting out with MariaDB for Windows, it is recommended to use the MSI
packages. The following are the steps to do just that:

1. Download the MSI package from https://downloads.mariadb.org/


location. First click on the series that we want (whatever is the current stable
version, most likely), then locate the Windows 64-bit or Windows 32-bit MSI
package. For most Windows PCs, the 64-bit MSI package is probably the one
that we want, especially if we have more than 4 GB of RAM. If you're unsure,
the 32-bit package will work on both 32-bit and 64-bit Windows computers.

[4]

www.it-ebooks.info
Chapter 1

2. Once the download has finished, launch the MSI installer by double-clicking
on it. Depending on the local Windows settings, you may be promoted
to launch the installer automatically. The installer will walk us through
installing MariaDB.

3. If we are installing MariaDB for the first time, we must be sure to set the
MariaDB root user password when prompted. This is done by checking the
Modify password for database user 'root' checkbox and then filling in our
chosen password two times in the provided textboxes.
4. Unless you need to, don't check the Enable access from remote machines for
'root' user or the Create An Anonymous Account checkboxes. We'll cover
creating regular user accounts in Chapter 4, Administering MariaDB.

[5]

www.it-ebooks.info
Installing MariaDB

5. The Use UTF8 as the default server's character set checkbox is unchecked by
default, but it's a good idea to check it, as shown in the following screenshot:

6. The Install as service box is checked by default, and it is recommended to


keep it that way so that MariaDB starts up when the computer is booted.
7. The Service Name textbox has the default value MySQL for compatibility
reasons, but we can rename it if we like. This name is what Windows uses to
identify the running service, and it does not affect MariaDB so, it is okay to
rename or keep it as the default name.
8. Check the Enable networking option if you need to access your databases
from a different computer. If you don't need remote access, it's best to
uncheck this box. As with the service name, there is a default TCP port,
number 3306, which we can change if we want to, but it is usually best to
stick with the default unless there is a specific reason not to.

[6]

www.it-ebooks.info
Chapter 1

9. The Optimize for transactions checkbox is also checked by default. This is


the recommended setting, as shown here:

10. One easy way to help the MariaDB developers is to check the Enable the
Feedback plugin checkbox, as shown in the following screenshot. When
enabled, the feedback plugin submits anonymous usage information to
the MariaDB Foundation. This information includes things such as what
plugins are enabled, how much memory MariaDB uses, and the operating
system that we are using. MariaDB developers use this information to guide
MariaDB development.

[7]

www.it-ebooks.info
Installing MariaDB

11. There are other settings that we can make through the installer. All of
them can be changed later by editing the my.ini file. We will be covering
this in Chapter 2, Configuring MariaDB, so we don't need to worry about
them right away.
12. If our version of Windows has user account control enabled, a pop-up
window will appear during the installation asking if we want to allow
the installer to install MariaDB. For obvious reasons, we will need to
click on Yes.
13. Once the installation is complete, there will be a MariaDB folder added to the
start or the programs menu. There will be various links under this, including
one to the mysql command-line client application. We will be using this
application in Chapters 5-7.

If we already have an older version of MariaDB or MySQL


running on our machine, we will be prompted to upgrade
the data files to the correct format for the version we are
installing. It is highly recommended to do that.

14. Eventually, we will be presented with a dialog box containing an installation


complete message and a Finish button. At this point, MariaDB is installed
and running on our Windows-based computer. Congratulations! Click on
Finish to quit the installer.

To install MariaDB on Mac OS X or Linux, read on; otherwise, feel free to skip
those sections.

Installing MariaDB on Mac OS X


One of the easiest ways to install MariaDB on Mac OS X is to use Homebrew,
which is an open source package manager for that platform. Before you can install it,
however, you need to prepare your system. The first thing you need to do is install
Xcode—Apple's integrated development environment. It's available for free from the
Mac App Store.

Once Xcode is installed, you can install brew. Full instructions are available on the
Homebrew Project website at http://brew.sh but the basic procedure is to open a
terminal and run the following command:
ruby -e "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install)"

[8]

www.it-ebooks.info
Chapter 1

The preceding command downloads the installer and runs it. Once the initial
installation is complete, we run the following command to make sure everything
is set up properly:
brew doctor

The output of the preceding command will tell us about any potential issues, along
with suggestions to fix them. Once brew is working properly, we can install MariaDB
with the following commands:
brew update
brew install mariadb

There is no option to choose a specific MariaDB series; whatever is


the current version in brew is the one that will be installed. Also,
brew will not prompt you to set a database user password during
installation, this is dangerous, so be sure to set one immediately
afterwards, following the instructions in Chapter 3, Securing MariaDB.

MariaDB will not automatically be started after installation. To do so, we run the
following commands:
ln -sfv /usr/local/opt/mariadb/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist

To stop MariaDB, we use the unload command, as follows:


launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist

To learn about installing MariaDB on Linux, read on. Otherwise, skip to the After the
installation section at the end of this chapter.

Installing MariaDB on Debian, Ubuntu,


and Linux Mint
The procedure to install MariaDB on Debian GNU/Linux, Ubuntu, and Linux Mint is
easy and starts with a visit to the repository configuration tool from:

https://downloads.mariadb.org/mariadb/repositories

This tool is used for APT-based Linux distributions, such as Debian, Ubuntu, and
Mint; Yum-based Linux distributions, such as Fedora, CentOS, and Red Hat; and
other distributions that have support for MariaDB built-in, such as Mageia, Arch
Linux, Suse, openSUSE, and others.

[9]

www.it-ebooks.info
Installing MariaDB

Many Linux distributions offer MariaDB in their repositories either as


the default MySQL-compatible database or as an alternative choice.
The instructions here will install MariaDB directly from the MariaDB
repositories instead of from your Linux distribution's repositories.

Before using the tool, we need to know which version of Ubuntu, Debian, or
Mint we are currently using. If you do not know, an easy way to find out is
with the following command:
cat /etc/lsb-release

The output will be similar to the following:


DISTRIB_ID=Ubuntu

DISTRIB_RELEASE=14.04

DISTRIB_CODENAME=trusty

DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"

This example output shows that the computer is running Ubuntu 14.04.1 LTS "Trusty".
So, using the repository configuration tool, we will click on Ubuntu, then 14.04 LTS
"trusty", and then on the MariaDB series we want to install. Lastly, we will click on the
mirror we want to use. The tool will then output three pieces of text. The first contains
the commands to add the MariaDB repository to our system. The second contains the
commands to actually install MariaDB. The third block of text contains alternative
instructions in case adding the repository using the first set did not work.

For example, the generated commands for adding a repository for MariaDB 10.1 for
Ubuntu 14.04 LTS "trusty" and using the osuosl mirror are as follows:
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys \
--keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository \
'deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu trusty main'

The first command installs the software-properties-common package if it is not


already installed. This package contains the add-apt-repository command we use
to install the repository. The second command imports the GPG encryption key that is
used to sign MariaDB packages. For more information about this key, see the MariaDB
package security section later in this chapter. The third command adds the repository.
[ 10 ]

www.it-ebooks.info
Chapter 1

Now that the repository is configured, we can install MariaDB using the following
installation commands:
sudo apt-get update
sudo apt-get install mariadb-server

The mariadb-server package depends on the other MariaDB packages, so these two
commands are all we need to install MariaDB. Once the second apt-get command
finishes, MariaDB will be installed and running.

To learn about installing MariaDB on Fedora, Red Hat, and CentOS, read on.
Otherwise, jump ahead to the MariaDB package security section if you're interested in
the MariaDB GPG signing keys, or skip to the After the installation section if you want
to start using MariaDB right away.

Installing MariaDB on Fedora, Red Hat,


and CentOS
The procedure to install MariaDB on Fedora, Red Hat, and CentOS makes use of the
Yellowdog Updater, Modified (YUM) package manager. There are two steps: first,
create a repo file for MariaDB and second, install MariaDB.

To generate the required text for the repo file, we will visit the MariaDB repository
configuration tool from:

https://downloads.mariadb.org/mariadb/repositories/

This tool is used for APT-based Linux distributions, such as


Debian, Ubuntu, and Mint; Yum-based Linux distributions,
such as Fedora, CentOS, and Red Hat; and other distributions
that have support for MariaDB built-in, such as Mageia, Arch
Linux, Suse, openSUSE, and others.

To generate the text, we simply click on the distribution we are using, the
distribution release we are using, and the version of MariaDB we want to install.
After doing so, the contents of the appropriate repo file will be displayed.

[ 11 ]

www.it-ebooks.info
Installing MariaDB

For example, the text generated for MariaDB 10.1 on the 64-bit version of CentOS 7 is
as follows:
# MariaDB 10.1 CentOS repository list
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

The gpgkey line tells YUM where the GPG signing key is located. The gpgcheck=1
line directs YUM to always use the signing key to verify the MariaDB packages.

The first time we install MariaDB, our system will not have the key, so YUM will
have to download and install it. Since YUM has never used the key before, it will ask
for confirmation whether it is OK to import the key. See the MariaDB package security
section for more information on the MariaDB GPG signing key.

We copy and paste the generated text into a file using our favorite text editor.
Naming the file descriptively, such as MariaDB.repo, is recommended. Once the
file is created, we then move it to the /etc/yum.repos.d/ folder using a command
similar to the following one:
sudo mv -vi MariaDB.repo /etc/yum.repos.d/

Once the file is in place, we are ready to install MariaDB. This is as simple as
the following:
sudo yum install MariaDB-server MariaDB-client

The capitalization of the package names is important because if we type mariadb-


server instead of MariaDB-server, we will either get a package cannot be found
error or, if we are using a distribution that includes MariaDB, we will get the
distribution version of MariaDB instead of the version from the MariaDB project.

[ 12 ]

www.it-ebooks.info
Chapter 1

YUM will gather in all of the dependencies for MariaDB and present us with a list
of everything that needs to be installed to install MariaDB. The following screenshot
shows this:

After answering y, the installation will get going and we will be prompted to accept
the GPG signing key. We will verify the fingerprint with y. YUM will then continue
downloading and installing MariaDB and will end with a Complete! message.

As a final step of the installation, we start MariaDB with the following command:
sudo /etc/init.d/mysql start

[ 13 ]

www.it-ebooks.info
Installing MariaDB

If everything has gone well, we will see output similar to the following:
[dbart@centos70-x86-64 ~]$ sudo /etc/init.d/mysql start

Starting MySQL.. SUCCESS!

MariaDB is now installed and running.

Jump ahead to the MariaDB package security section if you're interested in the MariaDB
GPG signing key, or skip to the After the installation section if you want to start using
MariaDB right away.

Installing MariaDB on other Linux


distributions
MariaDB is available on more Linux distributions than just the ones listed previously
in this chapter, and even if no formal packages are provided, the MariaDB developers
provide generic Linux binaries that work with many versions of Linux. Instructions on
how to install and use the generic binaries are available from:

https://mariadb.com/kb/en/mariadb/installing-mariadb-binary-tarballs/

Before installing these generic packages, however, it is worth your while to look in
your distribution's package manager to see if MariaDB is already there.

MariaDB package security


The packages provided by the MariaDB developers are signed with a security key so
that they can be verified by package managers such as yum and apt. The key signing
and verification infrastructure on Linux is called Gnu Privacy Guard (GPG). It is a
compatible open source version of Pretty Good Privacy (PGP), which is an industry
standard data encryption, decryption, and verification system.

[ 14 ]

www.it-ebooks.info
Chapter 1

The identification number (GPG ID) of the MariaDB signing key is


0xcbcb082a1bb943db. For longtime users of GPG, this ID may seem a little long.
That's because, until recently, it was common to share a short form of the GPG ID.
This is discouraged now because of a GPG vulnerability discovered a couple years
ago; however, many utilities will still display the short form by default. The long
form of the ID is more secure, so this is what the MariaDB developers share when
talking about the key. But, in case we want it, the short form of the ID is 1BB943DB
(it's just the last eight characters of the long form ID). For the extra cautious, the full
key fingerprint is:
1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB

The key IDs and fingerprint are also posted in the MariaDB Knowledge Base, which
is the official location of the MariaDB documentation and is available from:

https://mariadb.com/kb/en/mariadb/gpg/

By checking the signature of the packages, Linux package managers, and more
importantly, WE can verify whether the package that comes from the MariaDB
developers and hasn't been tampered with since they created it.

When configuring the MariaDB repository on Debian and Ubuntu and during the
initial MariaDB install on Fedora, Red Hat, and CentOS, an important task is to
import the signing key. It's a good idea to verify the key by comparing it to the IDs
and the fingerprint when doing so. Thankfully, this is a one-time operation. Once
the key is imported, the process is fully automatic. We will only be notified if the
signature check fails.

For MariaDB Windows, binary Linux, and the MariaDB source code files, we can
verify them in two ways, first is by comparing the md5sum of the file we downloaded
with the md5sum posted on the MariaDB downloads page next to the file. The second
way is to use PGP or GPG to verify the cryptographic signature of the file. These
signatures are also posted on the MariaDB downloads page.

After the installation


After installing MariaDB, we can quickly verify that MariaDB is up and running by
opening a terminal or command-line window and running the following command
(on Windows, we can also open the mysql.exe client in the MariaDB folder):
mysql -u root -p

[ 15 ]

www.it-ebooks.info
Installing MariaDB

This command connects to MariaDB as the root user (-u root) and prompts for
the password of that user (-p). When prompted, we will type in the password
we configured during installation. If no password was set during installation, we
simply remove the -p from the command. Until a password is set, we can connect
without a password.

Not having a password for the root user is dangerous! If


you did not set one during the installation, be sure to set one
immediately after the install, following the instructions in
Chapter 3, Securing MariaDB.

If MariaDB has been successfully installed and started, we should see something
similar to the following screenshot when connecting using the previous command
to launch the mysql command-line client:

If you get the MariaDB command-line prompt, as illustrated in the preceding


screenshot, congratulations! You've just installed MariaDB and can successfully
connect to the server using the command-line client. You can quit the command-line
client for now. Don't worry; we'll come back to it soon.

Troubleshooting installation issues


The MariaDB installers work very well, and they are tested and retested constantly.
Occasionally, issues with either installing MariaDB or running it for the first time are
discovered, but they are almost always fixed promptly so that users are not affected.

If we do happen to run into an issue when trying to start MariaDB, what should
we do?

[ 16 ]

www.it-ebooks.info
Chapter 1

The first thing we should do is look in the error log. The MariaDB error log is either
stored with the system log files (for example, under /var/log/ on Linux) or in the
MariaDB data directory. Common locations for the MariaDB data directory include
/var/lib/mysql/ on Linux, C:\Program Files\MariaDB <version>\data\ on
Windows (<version> is the version number of MariaDB we are using), and /usr/
local/var/mysql/ on Mac OS X. The error log file itself will either be called mysql.
err or hostname.err where "hostname" is the name that we've given our computer.
It is also worth noting that the name and location of the log file can be customized by
either the my.cnf file or the my.ini file. Chapter 2, Configuring MariaDB, will delve
further into this file and its location.

Each entry inside the error log file consists of a timestamp and a description of what
went wrong at that timestamp. Sometimes, the information given is enough for us to
figure it out ourselves, but at other times, we may need to ask for help. We shouldn't
feel bad if we can't figure out an error; even experts are sometimes stumped! If we do
need to ask for help, the resources listed on the following link, especially the Maria
discuss mailing list and the official IRC channel can help greatly:
https://mariadb.com/kb/en/mariadb/where-are-other-users-and-
developers-of-mariadb/

Summary
In this chapter, we installed MariaDB on various operating systems. Our next task is
to configure it, which also happens to be the subject and the title of the next chapter.

[ 17 ]

www.it-ebooks.info
www.it-ebooks.info
Configuring MariaDB
MariaDB is installed with a generic configuration that is suitable for general use.
This is perfect for giving MariaDB a try but might not be suitable for a production
database application under a heavy load. There are thousands of ways to tweak the
settings to get MariaDB to perform just the way we need it to. Many books have
been written on this subject. In this chapter, we'll cover enough of the basics so that
we can comfortably edit the MariaDB configuration files and know our way around.
Think of this chapter as a MariaDB configuration highlights tour.

The topics that we will cover in this chapter include the following:

• The MariaDB filesystem layout


• Modular configuration on Linux
• The anatomy of the MariaDB configuration file
• Activating configuration changes

The MariaDB filesystem layout


A MariaDB installation is not a single file or even a single directory, so the first
stop on our tour is a high-level overview of the filesystem layout. We'll start with
Windows and then move on to Linux.

The MariaDB filesystem layout on Windows


On Windows, MariaDB is installed under a directory named with the
following pattern:
C:\Program Files\MariaDB <major>.<minor>\

[ 19 ]

www.it-ebooks.info
Configuring MariaDB

In the preceding command, <major> and <minor> refer to the first and second
number in the MariaDB version string. So for MariaDB 10.1, the location would be:
C:\Program Files\MariaDB 10.1\

The only alteration to this location, unless we change it during the installation,
is when the 32-bit version of MariaDB is installed on a 64-bit version of Windows.
In that case, the default MariaDB directory is at the following location:
C:\Program Files x86\MariaDB <major>.<minor>\

Under the MariaDB directory on Windows, there are four primary directories: bin\,
data\, lib\, and include\. There are also several configuration examples and other
files under the MariaDB directory and a couple of additional directories (docs\ and
Share\), but we won't go into their details here.

The bin\ directory is where the executable files of MariaDB are located.

The data\ directory is where databases are stored; it is also where the primary
MariaDB configuration file, my.ini, is stored. We'll talk about this file later in the
section The anatomy of the MariaDB configuration file.

The lib\ directory contains various library and plugin files.

Lastly, the include\ directory contains files that are useful for application developers.

We don't generally need to worry about the bin\, lib\, and include\ directories;
it's enough for us to be aware that they exist and know what they contain. The
data\ directory is where we'll spend most of our time in this chapter, and when
using MariaDB.

Feel free to read the next two sections, which explain the location of MariaDB
files on Linux systems, or jump ahead to the section The anatomy of the MariaDB
configuration file.

The MariaDB filesystem layout on Linux


On Linux distributions, MariaDB follows the default filesystem layout. Feel free to
skip this section if you are working with Windows.

For example, the MariaDB binaries are placed under /usr/bin/, libraries are placed
under /usr/lib/, manual pages are placed under /usr/share/man/, and so on.

However, there are some key MariaDB-specific directories and file locations that we
should know about. Two of them are locations that are the same across most Linux
distributions. These locations are the /usr/share/mysql/ and /var/lib/mysql/
directories.
[ 20 ]

www.it-ebooks.info
Chapter 2

The /usr/share/mysql/ directory contains helper scripts that are used during
the initial installation of MariaDB, translations (so we can have error and system
messages in different languages), and character set information. We don't need to
worry about these files and scripts; it's enough to know that this directory exists
and contains important files.

The /var/lib/mysql/ directory is the default location for our actual database
data and the related files such as logs. There is not much need to worry about this
directory as MariaDB will handle its contents automatically; for now, it's enough to
know that it exists.

The next directory we should know about is the one where the MariaDB plugins are
stored. Unlike the previous two, the location of this directory varies. On Debian and
Ubuntu systems, this directory is at the following location:
/usr/lib/mysql/plugin/

In distributions such as Fedora, Red Hat, and CentOS, the location of the plugin
directory varies depending on whether our system is 32 bit or 64 bit. If unsure,
we can just look in both. The possible locations are:
/lib64/mysql/plugin/
/lib/mysql/plugin/

The basic rule of thumb is that if we don't have a /lib64/ directory, we have a 32-bit
version of Fedora, Red Hat, or CentOS installed.

As with /usr/share/mysql/, we don't need to worry about the contents of the


MariaDB plugin directory. It's enough to know that it exists and contains important
files. Also, if in the future we install a new MariaDB plugin, this directory is where it
will go.

The last directory that we should know about is only found on Debian and the
distributions based on Debian such as Ubuntu. Its location is as follows:
/etc/mysql/

The /etc/mysql/ directory is where the configuration information for MariaDB is


stored; specifically, it is stored in the following two locations:
/etc/mysql/my.cnf
/etc/mysql/conf.d/

There are additional files in the directory, but we can safely ignore them for now.
We'll look into the contents of the my.cnf file in the section The anatomy of the
MariaDB configuration file, and we'll talk about the special /etc/mysql/conf.d/
directory in the Modular configuration on Linux section.
[ 21 ]

www.it-ebooks.info
Configuring MariaDB

Fedora, Red Hat, CentOS, and related systems don't have an /etc/mysql/ directory
by default, but they do have a my.cnf file and a directory that serves the same
purpose that the /etc/mysql/conf.d/ directory does on Debian and Ubuntu.
They are at the following two locations:
/etc/my.cnf
/etc/my.cnf.d/

The my.cnf files, regardless of location, function the same on all Linux versions
and on Windows, where it is often named my.ini. The /etc/my.cnf.d/ and /etc/
mysql/conf.d/ directories, as mentioned, serve the same purpose. We'll spend the
next section going over these two directories.

Modular configuration on Linux


The /etc/my.cnf.d/ and /etc/mysql/conf.d/ directories are special locations for
the MariaDB configuration files. They are found on the MariaDB releases for Linux
such as Debian, Ubuntu, Fedora, Red Hat, and CentOS.

We will only have one or the other of them, never both, and regardless of which one
we have, their function is the same. The basic idea behind these directories is to allow
the package manager (APT or YUM) to be able to install packages for MariaDB,
which include additions to MariaDB's configuration without needing to edit or
change the main my.cnf configuration file. It's easy to imagine the harm that would
be caused if we installed a new plugin package and it overwrote a carefully crafted
and tuned configuration file. With these special directories, the package manager can
simply add a file to the appropriate directory and be done.

When the MariaDB server and the clients and utilities included with MariaDB start
up, they first read the main my.cnf file and then any files that they find under the
/etc/my.cnf.d/ or /etc/mysql/conf.d/ directories that have the extension .cnf
because of a line at the end of the default configuration files. For example, MariaDB
includes a plugin called feedback whose sole purpose is to send back anonymous
statistical information to the MariaDB developers. They use this information to help
guide future development efforts. It is disabled by default but can easily be enabled
by adding feedback=on to a [mysqld] group of the MariaDB configuration file (we'll
talk about configuration groups in the following section). We could add the required
lines to our main my.cnf file or, better yet, we can create a file called feedback.cnf
(MariaDB doesn't care what the actual filename is, apart from the .cnf extension)
with the following content:
[mysqld]
feedback=on

[ 22 ]

www.it-ebooks.info
Chapter 2

All we have to do is put our feedback.cnf file in the /etc/my.cnf.d/ or /etc/


mysql/conf.d/ directory and when we start or restart the server, the feedback.cnf
file will be read and the plugin will be turned on. Doing this for a single plugin
on a solitary MariaDB server may seem like too much work, but suppose we have
100 servers, and if we further assume that since the servers are doing different
things, each of them has a slightly different my.cnf configuration file. Without
using our small feedback.cnf file to turn on the feedback plugin on all of them, we
would have to connect to each server in turn and manually add feedback=on to the
[mysqld] group of the file. This would get tiresome and there is also a chance that
we might make a mistake with one or several of the files that we edit, even if we try
to automate the editing in some way. Copying a single file to each server that only
does one thing (turning on the feedback plugin in our example) is much faster and
much safer. And, if we have an automated deployment system in place, copying the
file to every server can be almost instant.

Caution! Because the configuration settings in the /etc/my.cnf.d/


or /etc/mysql/conf.d/ directory are read after the settings in
the my.cnf file, they can override or change the settings in our main
my.cnf file. This can be a good thing if that is what we want and expect.
Conversely, it can be a bad thing if we are not expecting that behavior.

The anatomy of the MariaDB


configuration file
Looking at the contents of the MariaDB configuration file for the first time can be
a scary experience, but it doesn't have to be. It's actually laid out quite logically.
Sometimes, the hardest part is just knowing where it is. We'll review that first,
and then go into the various parts that make up the file.

The configuration file is just a text file and we can edit it with our favorite text
editor. Even though the extensions may be different (.ini or .cnf), the contents of
the files are the same. Apart from empty lines, which can be ignored, there are four
main types of entries in a MariaDB configuration file. These are: comments, groups,
options with no values, and options with values. We'll discuss each of them in turn.

Where is my configuration file?


This may seem like a question that should have only one answer, but in an effort to
be flexible, MariaDB looks for the my.cnf or the my.ini configuration file in several
different locations.

[ 23 ]

www.it-ebooks.info
Configuring MariaDB

As mentioned previously, on Windows, the MariaDB configuration file is named


my.ini by default and is found in the data directory (see the section The MariaDB
filesystem layout on Windows to learn where the data directory is located on Windows).
The file can also be named my.cnf, just as it is in Linux, and MariaDB will also look in
the following additional locations for it:
C:\WINDOWS\my.ini
C:\WINDOWS\my.cnf
C:\my.ini
C:\my.cnf

On Linux, the MariaDB configuration file is always named my.cnf and is almost
always found at one of the following two locations:
/etc/my.cnf
/etc/mysql/my.cnf

MariaDB will look for the file at both locations, but if the files exist at both locations,
the options in the file that MariaDB reads last will override the options that it read in
the first file. So, to avoid confusion, we should only have one or the other and if we
discover we have both for some reason, we should combine them into one file.

Comments
Comment lines are lines that begin with # (the hash character) or ; (a semicolon).
Comments are ignored by MariaDB. They often contain useful information and are a
great place to keep notes when we make changes to the file. Comments can also start
in the middle of the line. Just think of anything from the initial comment character to
the end of a line as a comment. Here are some examples:
# Here is a comment
; This is also a comment
port = 3306 # This is a comment about the 'port' option

Groups
Groups are sections or parts in a configuration file. A typical MariaDB installation
is composed of a server program, one or more client programs, and several utility
programs. Each of these have their own individual configuration options and they
can all be set in our my.cnf or my.ini file. Even the individual series of MariaDB
have their own group identifiers (these are useful if we are testing a development
version and want to enable a new feature without affecting older servers that use
the same configuration file).

[ 24 ]

www.it-ebooks.info
Chapter 2

A group begins with a name enclosed in square brackets ([]) on a line, by itself.
The group continues to the end of the file or to the beginning of the next group,
whichever comes first. The following is an example of the often used mysqld group:
[mysqld]
# Configuration options for the mysqld program go here

Incidentally, mysqld is the name of the MariaDB server program binary. The group
is named after the binary's file name. In addition to [mysqld], other common groups
include the following:
[server]
# the same as [mysqld]
[mysql]
# configuration options for the mysql command-line client
[client]
# the same as [mysql]
[client-server]
# configuration options for both clients and the server
[mysqladmin]
# configuration options for the mysqladmin program
[mysqlcheck]
# configuration options for the mysqlcheck utility
[mariadb-10.1]
# configuration options just for MariaDB 10.1 series servers

There are many other possible groups, but these are enough to get the idea. We just
use the ones we want and can ignore the others.

In each group, we set options. There are two types, those which don't require a
corresponding value and those that do.

Options that do not require values


Configuration options either take a value or not. Those that do not need a value
appear on a line by themselves with no equals sign (=). They are used for options that
are either on or off, so there is no need for arguments. If it exists in the configuration
file (and isn't commented out), the feature is considered on. If it doesn't exist (or it is
commented out), the feature is set to whatever the default is (ON or OFF). An example
would be as follows:
no-auto-rehash

[ 25 ]

www.it-ebooks.info
Configuring MariaDB

To turn OFF a feature that is ON by default, just add =OFF to it as follows:


no-auto-rehash=OFF

We can also be more explicit about turning a feature on by appending =ON to an


option. It's not necessary, though.

Options that require values


As mentioned in the previous section, some configuration options require a value of
some sort to be set. For example, the default [client] section in the Ubuntu version
of the MariaDB my.cnf file contains the following two options:
port = 3306
socket = /var/run/mysqld/mysqld.sock

Setting options such as port or socket, or any other settings that require a value,
without giving a value, will cause an error and MariaDB may refuse to start.

There is a special line at the end of Linux my.cnf files. It begins


with an exclamation mark (!) and its purpose is to include the
special /etc/mysql/conf.d/ or /etc/my.cnf.d/ directory.
Don't change or remove this line!

Option formatting
Option names are not case sensitive and we can vary the number of spaces around
the equals (=) sign. We can also choose to use dashes (-) or underscores (_) in the
names. For example, the following two options are the same:
max_allowed_packet = 1M
MAX-Allowed-Packet = 1M

One exception to this is with options that have values (described in the Options that
require values section). If the value is a file or location on a case-sensitive filesystem,
like those used on Linux, that value will be case sensitive. The option name itself is
not case-sensitive, but the value is. For example, the first two of the following three
examples work the same but the third one does not (and on Linux, it will almost
assuredly not work):
socket = /var/run/mysqld/mysqld.sock
SOCKET = /var/run/mysqld/mysqld.sock
socket = /VAR/run/MySQLd/mysqld.sock

[ 26 ]

www.it-ebooks.info
Random documents with unrelated
content Scribd suggests to you:
from the chalk land-surface (the chalk itself not now reaching the
shore-line of East Anglia), are greatly predominant. It is in the chalk
that flint takes its origin, being found there as large irregular nodules
and sheets.
CHAPTER VII

THE CONSTITUENTS OF A SEABEACH

I
ONCE went down to Aldeburgh, on the Suffolk coast, with a party
of friends, which included an American writer, himself as delightful
and charming as his stories. Why should I not give his name? It was
Cable, the author of "Old Creole Days." We walked through the little
town to the sea-front, and came upon the immense beach spreading
out for miles towards Orford Ness. "Well, I never!" said he to me; "I
suppose the hotel people have put those stones there to make a
promenade for the visitors. It's a big thing." It took me some time to
persuade him that they were brought there by the sea and spread
out by it alone. It was his first visit to Europe, but he had seen the
seashore on the other side, and there was nothing like this over
there, he declared. A similar readiness to ascribe Nature's handiwork
to the enterprise of hotel-keepers led a visitor to the Bel Alp, in the
Rhone Valley, when he looked down from that high-placed hostelry
on to the great Aletsch glacier, with its central "moraine" of huge
rock masses and debris, to exclaim, "I see the proprietor has spread
a cinder-path along the glacier to prevent us from slipping. It's a
convenience, no doubt, but gives a nasty dirty look to the snow." Mr.
Cable, when he once realized that the great Aldeburgh beach was a
natural production, did what a true poet and naturalist must do—he
fell in love with it, and spent hours in filling his pockets with strange-
looking pebbles of all kinds until he was brought into the house to
dinner by main force, when he spread his collection on the table,
and demanded an explanation of "what, whence, and why" in regard
to each pebble. Our companions—a great lawyer, a military hero, a
politician, and two "learned men"—regarded him as eccentric, not to
say childish. But I entirely sympathized with him, and when next day
we sailed down to Orford and stood in front of the old Norman
fortress, he further established himself in my regard by deeply
sighing and exclaiming, "So that is a real English castle!" whilst
several large tears quietly streamed down his undisturbed
countenance.
To give an idea of what various rocks from far-distant localities may
be brought together on an East Coast beach, take that of Felixstowe
as an example. What is true of the East Coast is to some extent also
true of the South Coast, and, indeed, wherever the sea makes the
pebbles of a modern beach from the materials furnished by the
breaking up of old deposits, which were in their day brought by ice-
flows or torrential currents from remote regions. The most abundant
kind of pebbles on the Felixstowe beach are small, rounded,
somewhat flat pieces of flint, derived not directly from the chalk
which is the "stratum" or "bed" in which flint is originally formed, but
from the Red Crag capping the clay cliffs (London clay or early
Eocene), and also from surface washings and "gravels" (of later age
than the crag) farther north, whence they have travelled southward
with many other constituents of the beach. All these flints are
stained ruddy brown or yellow by iron—a process they underwent
when lying in the gravels or in the crag in which they were deposited
as pebbles, broken, washed, and rolled ages ago from the chalk. The
iron is in a high state of oxidation, and stains not only flint pebbles
but the sands of the Red Crag and later gravels a bright orange-red,
or sometimes a less ruddy yellow. The iron comes originally from
very ancient igneous rocks in which it is black and usually combined
with silica. The chalk flints are always, owing, it seems, to minute
quantities of carbon, quite black in the mass, but thin, translucent
splinters have a yellowish-brown tint. The flints are free from iron
stain when taken direct from the chalk. The commonest pebble next
to flint is milky quartz, or opaque white quartz. This is derived from
some far northern source, where there are igneous rocks traversed
by veins of this substance (perhaps Norway). Quartz, like flint, is
pure silica, the oxide of the element silicon. It appears in another
form as rock-crystal, and also as chalcedony and agate. Opal also is
pure silica, but differs from quartz and its varieties in being non-
crystalline or amorphous, and in being less hard and of less specific
gravity than quartz. Opal is soluble in alkaline water containing free
carbonic acid, such as are many natural waters and the sea! But
quartz is not so. The siliceous "spicules" and skeletons of many
microscopic animals and plants are "opal." The gem known as "opal"
is a variety owing its beauty to minute fissures in its substance which
break up light into the prismatic colours.
A great deal rarer than the milky quartz, but well known on the East
Coast on account of their beauty, and often sought for to be cut and
polished, are the small rolled bits or pebbles of chalcedony or agate,
which have been bedded before their appearance on the beach in
some of the pre-glacial or post-glacial gravels, together with the
flints, and in consequence are often stained of a fine red. Such clear
red-stained chalcedony is called "carnelian"; if the banded agate
structure shows, it is called agate rather than carnelian. It is
wonderful how many beautiful pieces of both carnelian and agate
are picked up on the Felixstowe beach, rarely, however, bigger than
a hazel nut. The original source of these carnelians and agates is the
East of Scotland. At Montrose you may see the igneous rock
containing pale, lavender-coloured agate nodules as big as a potato,
the breaking and rolling of which by the sea into small bits has
furnished our Suffolk carnelians. Quartzite—more or less translucent,
sandy-looking pebbles, colourless or yellow: jasper, black or green
with red veining: a fine wine-red or purple stone often veined with
quartz—are all more or less common, and come from northern
igneous rocks—possibly some from Scandinavia and some from the
breaking up of an ancient "breccia" of the Triassic age, which still
exists northwards of East Anglia.
Other pebbles very common on this shore are those formed in a
curious way by the sea-water from the clay cliffs and sea bottom
which are here present, and are of that special geologic age and
character known as the London clay. The sea at this moment is
continually converting the clay of our Suffolk shore into "cement-
stone" by a definite chemical process. The clay and many other
things submerged in the sea, as Shakespeare knew, "undergo a sea-
change." The cement-stone used to be dredged up from the sea
bottom and ground to make cement at Harwich. Great rock-like slabs
of it pave the shore at low water, and pebbles of it are abundant.
The curious thing is that ages ago—geological ages, I mean—when
the sea was throwing up here the old shell-banks and sand-banks
known nowadays as "the Red and Coralline Crags," the London clay
cliffs and clay sea bottom were in existence just as they are now.
But in that period there existed here enormous quantities of bones
of whales of kinds now extinct, which had lived a little earlier in the
sea of this area, and were deposited in vast quantity as a sort of first
layer of beach or shallow water sea-drift. Bones consist largely of
phosphate of lime, and are used as manure. In that old crag sea the
phosphate of lime was dissolved from the deposit of bones, and as
we find occurring in the case of other clays and other bones
elsewhere—was chemically taken up by the clay—the same kind of
clay which to-day is being converted into "cement-stone." It was
thus, at that remote period, converted into "clay phosphorite," owing
to the presence of the immense deposit of whales' bones, and it has
been known for sixty years as Suffolk "coprolite," owing to a
mistaken notion that it was the petrified dung of extinct animals. It
has been dug up by the ton from below the crag all over this part of
Suffolk, where it forms, together with bones, teeth, flints, and box-
stones, a bed of small nodules, a foot or so thick separating the
London clay from the shelly "crag." This bed is called the Suffolk
bone-bed or nodule-bed. The phosphorite, or "coprolite," occurs in
the form of bits of clay, hardened by phosphate of lime, and of the
colour of chocolate, and hundreds of tons of it have been used by
manufacturers of the manure known as "superphosphate." Henslow,
of Cambridge, Darwin's friend and teacher, was the first to point out
its value. Bits of it, as well as box-stones, and fragments of bone,
teeth of whales, of sharks, of mastodon, rhinoceros, tapir, and other
extinct animals—all fallen from the bone-bed in the cliff—are found
mixed with the pebbles of the Suffolk beach by those who lie on that
beach in the sunshine, and, for want of something better to do, turn
over handful after handful of its varied material. And, besides all the
stones I have already mentioned, they find amber, washed here by
some mysterious currents from the Baltic, wonderful fossil shells out
of the crag, the cameo shell, and the great volute,—shells which are
as friable as the best pastry when dug out of the Red Crag, but here
on the shore become hardened by definite chemical action of the
sea-water, so as to be as firm as steel. Here, too, the "chiffonier" of
the seashore finds recent shells, recent bones (slowly dissolving and
wearing away), well-rounded bits of glass, jet drifted down from
Whitby, Roman coins, bits of Samian ware (!), mediaeval keys, bits
of coal, burnt flints (from steamers' furnaces), and box-stones.
A very important and interesting thing about "beaches" is the way in
which the pebbles of which they consist are assorted in sizes.
Suppose that one prepares a trough some two or three yards long
and twelve inches deep, and lets it fill with water from a constantly
running tap, tilting it slightly so that the water will overflow and run
away at the end farthest from the tap. Then if one drops into the
trough near the tap handful after handful of coarse sand and small
stones of varied sizes, they will be carried along by the stream, and
the more rapid and voluminous the stream the farther they will be
carried. But they will eventually sink to the bottom of the trough, the
bigger pieces first, then the medium-sized, then the small, and the
smaller in order, as the current carries them along, so that one gets
a separation and sorting of the solid particles according to size, a
very fine sediment being deposited last of all at the far end of the
trough. The waves of the sea are continually stirring up and
assorting the constituents of the beach in this way. Usually the
largest pebbles are thrown up farthest by the advancing waves, and
dropped soonest by the backward suck of the retreating water, so
that one generally finds a predominance of big pebbles at the top of
the beach. But on the flat shore of firm ripple-marked sand lying
lower down than the sloping "beach" and only exposed at quite "low
tide," one often finds very big pebbles of eight or nine pounds
weight scattered here and there and little rubbed or rounded. They
have gradually moved down the sloping beach and are too heavy to
be thrown back again by the waves of the shallow sea which flows
over the flat shores characteristic of much of our south-eastern and
southern coast. On some parts of the coast huge banks, consisting
exclusively of enormous pebbles as big as a quartern loaf, are piled
up by the waves, forming a great ridge often miles in length, as at
the celebrated Chesil pebble bank near Weymouth, and at Westward
Ho! in North Devon. The presence of these specially large pebbles is
due to the special character of the rocks which are broken up by the
sea to form them, and to the specially powerful wave-compelling
winds and tidal currents at the parts of the coast where they are
produced.
One generally finds a selected accumulation of moderate-sized
pebbles lower down the beach as the tide recedes, and then still
lower down patches of sand alternating with patches or tracts of
quite small pebbles not much bigger than a dried pea. They are
always assorted in sizes, but the extent of each tract of a given size
of pebble varies greatly on different beaches along the coast, and
even from day to day on the same shore. The greater or less
violence of the waves, and of the currents caused by wind and tide,
is the cause of this variation and local difference. The pebbles of the
"beach" are, of course, always being worn away, rounded and
rubbed down by their daily movement upon one another, caused by
the waves as the tide mounts and again descends over the shore.
Even the biggest stones, excepting those which lie in deeper water
beyond the beach, are eventually rubbed down, and become quite
small; but a point is reached when, the weight of the pebbles being
very small, they have but little effect in rubbing down each other,
and consequently where the pebbles consist of very hard material—
like flints—the smallest ones are not so much rounded, but are
angular and irregular in shape.
Whilst a perfect gradation in size can be found from the largest flint
pebbles some 6 inches or 7 inches long to the smallest, usually not
bigger than a split pea (though sometimes a patch of even smaller
constituents may be found), there is a real break or gap between
"pebbles" and "sand." I am referring now to what is commonly
known as "sand" on the southern part of the East Coast, much of
the South Coast, and the shores of Holland, Belgium, and France.
There are "sands" of softer material (limestone and coral sand), but
the sands in question are almost entirely siliceous, made up of tiny
fragments of flint, of quartz, agate, and hard, igneous rock. They are
often called "sharp" sand. The particles forming this sand are sorted
out by the action of moving water, and form large tracts between
tide-marks looking like brown sugar, for which baby visitors have
been known to mistake them, and accordingly to swallow small
handfuls. The strong wind from the sea blows the sand thus
exposed, as it dries, inland out of reach of the tide, to form sand-
dunes, and it is also deposited, together with still finer particles
(those called "mud"), on the shallower parts of the sea bottom. The
curious thing about the particles of "sharp" sand is that they are
angular, and for the most part without rounded edges. If you
examine them under a microscope you will see that they do not look
like pebbles—in fact, they are not pebbles, for they are so small and
have so little weight, or, rather, mass, that they do not rub each
other to any effect when moved about in water. They look like, and,
in fact, are, for the most part broken bits of silica, unworn and
sharp-edged splinters and chips, glass-like in their transparency and
most of them colourless, a few only iron-stained and yellow.
Amongst these are a few rounded, almost spherical pieces, which
are no doubt of the nature of minute water-worn pebbles. Although
these few minute pebbles exist among the sharp, chiplike particles of
"sand," it is clear that we must broadly distinguish "pebbles" of all
sizes down to the smallest—from the much smaller "sand particles."
There is no intermediate quality of material between "sand" and the
finest "shingle."
CHAPTER VIII

QUICKSANDS AND FIRE-STONES

T
HERE are curious facts about sand which can be studied on the
seashore. There are the "quicksands," mixtures of sand and
water, which sometimes engulf pedestrians and horsemen at low
tide, not only at the Mont St. Michel, on the Normandy coast, but at
many spots on the English, Welsh, and Scotch coasts. Small and
harmless quicksands are often formed where the sand is not firmly
"bedded" by the receding sea, and the sea-water does not drain off,
but forms a sort of sand-bog. Then one may also study the polishing
and eroding effect of dry blown sand, which gives a "sand-glaze" to
flints, and in "sand-deserts" often wears away great rocks. The
natural polishing of flints and other hard bodies by fine sand carried
over them for months and years in succession by a stream of water,
is also a matter of great interest, about which archæologists want
further information.
A very interesting fact about the ordinary sand of the seashore is
that two pints of dry sand and half a pint of water when mixed do
not make two pints and a half, but less than that quantity. If you fill
a child's pail with dry sand from above the tide-mark, and then pour
on to it some water, the mass of sand actually shrinks. The reason is
that when the sand is dry there is air between its particles, but when
the sand-particles are wetted they adhere closely to each other; the
air is driven out, and the water does not exactly take an equivalent
space, but occupies less room than the air did, owing to the close
clinging together of the wet particles. If you add a little water to
some dry sand under the microscope, you will see the sand-particles
move and cling closely to one another. "Capillary attraction"—the
ascent of liquid in very fine tubes or spaces—is a result of the same
sort of adhesive action. If you walk on the firm, damp sand exposed
at low tide on many parts of the seashore when it is just free from
water on the surface, you will see that when you put your foot down
the sand becomes suddenly pale for some seven inches or so all
round your foot. The reason is that the water has left the pale-
looking sand (dry sand looks paler than wet sand), and has gone
into the sand under your foot, which is being squeezed by your
weight. The water passing into that squeezed sand enables its
particles to sit tighter or closer together, and so to yield to the
pressure caused by your weight. You actually squeeze water "into"
the sand, instead of squeezing water "out" of it, as is usually the
case when you squeeze part of a wet substance—say a cloth or a
sponge. When you lift your foot up, you find that your footmark is
covered with water—the water you had drawn to that particular spot
by squeezing it. It separates as soon as the pressure is removed.
Quartz and quartzite pebbles occur on the South as well as the East
Coast. They are sometimes called "fire-stones," because they can be
made to produce flashes of flame. If you take a couple of these
pebbles, each about as big as the bowl of a dessert-spoon (a couple
of flint pebbles will serve, but not so well), and holding one in each
hand in a dark room, or at night, scrape one with the other very
firmly, you will produce a flash of light of an orange or reddish
colour. And at the same time you will notice a very peculiar smell,
rather agreeable than otherwise, like that of burning vegetable
matter. It would seem that the rubbing together of the stones
produces a fine powder of some of the siliceous substance of the
stone and at the same time a very high temperature, which sets the
powder aflame. I had the idea at one time, based on the curious
smell given out by the flashing pebbles, that perhaps it was a thin
coating of vegetable or other organic matter derived from the sea-
water which burns when the stones are thus rubbed together; but I
found on chemically cleaning my pebbles, first with strong acid and
then with alkali, that the flame and the smell were produced just as
well by these chemically clean stones as by those taken from the
beach. The flame produced by the rubbing of the two stones
seemed then to be like the sparks obtained by strike-a-lights of flint
and steel, or the prehistoric flint and pyrites. Now, however, a new
fact demands consideration. The supposition that the powdered
silica formed, when one rubs the two pebbles together, is actually
"burnt," that is to say, combined with the oxygen of the air by the
great heat of the friction, is rendered unlikely by the fact that if you
perform the rubbing operation in a basin of water with the stones
submerged, the flash is produced as easily as in the air. My attention
was drawn to this fact by a letter from the well-known naturalist the
Rev. Reginald Gatty. I at once tried the experiment and found the
fact to be as my correspondent stated. Not only so, but the smell
was produced as well as the flash.
With the desire to get further light on the subject, I consulted the
great experimental physicist, my friend Sir James Dewar, in his
laboratory at the Royal Institution. He told me that the late Professor
Tyndal used to exhibit the production of flame by the friction of two
pieces of quartz in his lectures on heat, but made use of a very large
and rough crystal of quartz (rock-crystal) and rubbed its rough
surface with another large crystal. Tyndal's note on the subject in his
lecture programme was as follows (Juvenile Lectures on Heat, 1877-
78): "When very hard substances are rubbed together light is
produced as well as heat." Sir James Dewar kindly showed me the
crystals used by Tyndal, the larger was 16 inches long and 4 or 5
inches broad. We repeated the experiment in the darkened lecture
room, and obtained splendid flashes. The same smell is produced
when rock-crystal is used as when flint or quartz pebbles are rubbed
together. All three are the same chemical body, namely, silica (oxide
of silicon). We also found that when the crystals were bathed with
water or (this is a new fact) with absolute alcohol, the same flashing
was produced by the friction of one against the other.
Later, with the kind assistance of Mr. Herbert Smith, of the mineral
department of the Natural History Museum, I examined, with a
spectroscope, the flash given by two quartzite pebbles when rubbed
together. No distinctive lines or bands were seen; only a
"continuous" spectrum, showing that the temperature produced was
not high enough to volatilize the silicon. I also examined some
pebbles of another very hard substance—nearly as hard as silica
(rock-crystal, quartz, and flint). This was what is called "corundum,"
the massive form of "emery powder" (oxide of aluminium). By
grinding two of these corundum pebbles with very great pressure
one against the other (using much greater pressure than is needful
in the case of quartz), I obtained flashes of light. It was not known
previously that any pebbles except those of silica would give flashes
of light when rubbed together. A smell resembling that given out by
rubbed quartz, but fainter, was observed.
Those are the facts—new to me and to many others—about this
curious subject. The flashing under water is a very remarkable thing.
I cannot say that I am yet satisfied as to the nature of the flash. A
simple explanation of the result obtained, when two dry pebbles are
rubbed together in the air, is that crushed particles of the quartz or
of the corundum are heated by the heavy friction to the glowing
point. But this does not accord with the fact that submergence in a
liquid does not interfere with the flashing. The rise of temperature
would certainly be checked by the liquid. And the curious smell
produced is in no way explained.
The breaking of crystals is in many instances known to produce a
flash of light. Thus a lump of loaf sugar broken in the dark gives a
faint flash of blue light, as anyone can see for himself immediately
on reading this. White arsenic crystals also, when broken by shaking
the liquid in which they have formed, give out flashes of light. Some
rare specimens of diamond, when rubbed in the dark with a chamois
leather, glow brightly. The well-known mineral called Derbyshire spar,
"Blue John," or fluoride of calcium, when heated to a point much
below that of a red-hot iron, "crackles" and glows briefly with a
greenish light. The crystals of phosphate of lime, called apatite, and
a number of other crystals have this property. But there is no record
of any peculiar smell accompanying the flashes of light. It is still a
matter open to investigation as to whether the flashing of pieces of
quartz and rock-crystal when rubbed together with heavy pressure is
of the nature of the flashing of the heated crystals of other minerals,
or whether there is any chemical action set up by the friction—an
action which is certainly suggested by the very peculiar smell
produced. Since the flashing can be produced under water and other
liquids, it should be easy to obtain some evidence as to the chemical
nature of the flame—whether acid or alkaline, whether capable of
acting on this or that reagent dissolved in the water, and whether
setting free any gas of one kind or another.
Any one of my readers who chooses can produce the wonderful
orange-coloured flame by rubbing two quartz or flint pebbles
together in the dark, and can have the further gratification of
producing with the utmost ease the mysterious and weird
phenomenon of a flame under water, and may, perhaps, by further
experiment, explain satisfactorily this unsolved marvel which has
haunted some of us since childhood.
CHAPTER IX

AMBER

A
MBER is not unfrequently picked up among the pebbles of the East
Coast. I once picked up a piece on the beach at Felixstowe as big
as a turkey's egg, thinking it was an ordinary flint-pebble and
intending to throw it into the sea, when my attention was arrested by
its extraordinary lightness, and I found that I had got hold of an
unusually large lump of amber. There is a locality where amber occurs
in considerable quantity. It is a long way off—namely, the promontory
called Samland near Königsberg on the Prussian shore of the Baltic.
There it occurs with fossil wood and leaves in strata of early Tertiary
age, deposited a little later than our "London clay." It used to be
merely picked up on the shore there until recent times, when
"mining" for it was started. From this region (the Baltic coast of
Prussia) amber was carried by the earliest traders in prehistoric times
to various parts of Europe. Their journeyings can be traced by the
discovery of amber beads in connexion with interments and dwelling-
places along what are called "amber routes" radiating from the amber
coast of Prussia. To reach the East Coast of England the bits of amber
would have to be carried by submarine currents. Amber travels faster
and farther than ordinary stones, on account of its lightness. What
has been held to be amber is found, also embedded in ancient
Tertiary strata, in small quantity in France, in Sicily, in Burma, and in
green sand (below the chalk) in the United States. The Sicilian amber
(called "Simetite") was not known to the ancients: it is remarkable for
being "fluorescent," as is also some recently discovered in Southern
Mexico. But it is possible that chemically these substances are not
quite the same as true amber. Amber is a fossil resin or gum, similar
to that exuded by many living trees, such as gum-copal. It has been
used as an ornament from prehistoric times onwards, and was greatly
valued by the Egyptians, Greeks, and Romans, and by our Anglo-
Saxon ancestors, not only for decorative purposes, but as a "charm,"
it being supposed to possess certain magical properties.
Amber (it is generally believed) comes slowly drifting along the sea
bottom to the Suffolk shore from the Baltic. Lumps as big as one's fist
are sometimes picked up here. The largest pieces on record found on
the Baltic shore, or dug out of the mines there, are from 12 to 18 lb.
in weight, and valued at £1000. A party sent by the Emperor Nero
brought back 13,000 lb. of amber from the Baltic shores to Rome.
The bottom currents of seas and oceans, such as those which
possibly bring amber to our shores, are strangely disposed. The
Seigneur of Sark some fifty years ago was shipwrecked in his yacht
near the island of Guernsey; he lost, among other things, a well-
fastened, strongly-made chest, containing silver plate. It was found a
year later in deep water off the coast of Norway and restored to him!
In the really deep sea, over 1000 fathoms down, there are well-
marked broad currents which may be described as rivers of very cold
water (only four degrees or so above freezing-point). They flow along
the deep sea bottom and are sharply marked off from the warmer
waters above and to the side. Their inhabitants are different from
those of the warmer water. They are due to the melting of the polar
ice, the cold water so formed sinking at once owing to its greater
density below the warmer water of the surface currents. These deep
currents originate in both the Arctic and Antarctic regions, and the
determination of their force and direction, as well as of those of other
ocean currents, both deep and superficial, such as the warm "Gulf
Stream," which starts from the Gulf of Mexico, and the great
equatorial currents, is a matter of constant study and observation, in
which surveying ships and skilled observers have been employed.
Amber has not only been valued for its beauty of colour—yellow,
flame-colour, and even deep red and sometimes blue—for its
transparency, its lightness, and the ease with which it can be carved,
but also on account of certain magical properties attributed to it.
Pliny, the great Roman naturalist of the first century A.D., states that
a necklace of amber beads protects the wearer against secret
poisoning, sorcery, and the evil eye. It is first mentioned by Homer,
and beads of it were worn by prehistoric man. Six hundred years
B.C., a Greek observer (Thales) relates that amber when rubbed has
the power of attracting light bodies. That observation is the starting-
point of our knowledge of electricity, a name derived from the Greek
word for amber, "electron." In Latin, amber is called "succinum." By
heating in oil or a sand-bath, amber can be melted, and the softened
pieces squeezed together to form larger masses. It can also be
artificially stained, and cloudy specimens are rendered transparent by
heating in an oil-bath.
Amber is the resinous exudation of trees like the "Copal gum" of East
Africa and the "Kauri resin" or "Dammar" of New Zealand. Both of
these products are very much like amber in appearance, and can be
readily mistaken for it. The trees which produced the amber of the
Baltic were conifers or pine trees, and flourished in early Tertiary
times (many millions of years ago). Their leaves, as well as insects of
many kinds, which have been studied and named by entomologists,
are found preserved in it. There is a very fine collection of these
insects in the Natural History Museum in London. It is probable that
more than one kind of tree produced the amber-gum, and that its
long "fossilization" has resulted in some changes in its density and its
chemical composition. The East African copal is formed by a tree
which belongs to the same family as our beans, peas, and laburnum.
It is obtained when freshly exuded, but the best kind is dug by the
negroes out of the ground, where copal trees formerly grew and have
left their remains, so that copal, like amber, is to a large extent
fossilized. The same is true of the New Zealand dammar or kauri
gum, which is the product of a conifer called "Agathis australis," and
is very hard and amber-like in appearance. Chemically amber, copal,
and dammar are similar to one another but not identical. Amber, like
the other two, has been used for making "varnish," and the early
Flemish painters in oils, as well as the makers of Cremona violins,
made use of amber varnish.
A medicament called "eau de luce" was formerly used, made by
dissolving one of the products of the dry distillation of amber (called
"oil of amber") in alcohol. Now, however, amber is used only for two
purposes—besides decoration—namely, for the mouthpieces of pipes
and cigar tubes and for burning (for amber, like other resins, burns
with a black smoke and agreeable odour) as a kind of incense
(especially at the tomb of Mahomet at Mecca). These uses are chiefly
Oriental, and most European amber now goes to the East. In China
they use a fine sort of amber, obtained from the north of Burma. The
use of amber as a mouthpiece is connected with its supposed virtues
in protecting the mouth against poison and infection. It is softer than
the teeth, and therefore pleasant to grip with their aid; but as a cigar
or cigarette tube it is disadvantageous, as it does not absorb the oil
which is formed by the cooling of the tobacco smoke passing along it,
but allows it to condense as an offensive juice.
Forty years ago an old lady used to sit in the doorway of her timber-
built cottage in the village of Trimley (where there are the churches
of two parishes in one churchyard), smoking a short clay pipe and
carving bits of amber found on the Suffolk beach into the shape of
hearts, crosses, and beads. She would carve and polish the amber
you had found yourself whilst you joined her in a friendly pipe. You
were sure in those days of the genuine character of the amber, jet,
and agate sold as "found on the beach." Nowadays these things, as
well as polished agates and "pebbles from the beach," are, I am sorry
to say, manufactured in Germany, and sent to many British seaside
resorts, like the false coral and celluloid tortoise-shell which, side by
side with the genuine articles, are offered by picturesque Levantines
to the visitors at hotels on the Riviera, and even in Naples itself.
Nevertheless, genuine and really fine specimens of amber picked up
on the beach and polished so as to show to full advantage their
beautiful colour and "clouding" can still be purchased in the jeweller's
shop at Aldeburgh on the Suffolk coast near the great pebble beach
of Orfordness.
There are difficulties about using the word "amber" with scientific
precision. The fossil resins which pass under this name in commerce,
and are obtained in various localities, including the Prussian mines on
the Baltic, are undoubtedly the product of several different kinds of
trees, and, from the strictly scientific chemical point of view, they are
mixtures in varying proportions of different chemical substances. The
merchant is content with a certain hardness (which he tests with a
penknife), transparency, and colour, and also attaches great
importance to the test of burning a few fragments in a spoon, when,
if the material is to pass as "amber," it should give an agreeable
perfume. Scientifically speaking, "amber" differs from other "resins,"
including copal, in having a higher melting point, greater hardness,
slighter solubility in alcohol and in ether, and in containing "succinic
acid" as an important constituent, which the other resins, even those
most like it, do not. True amber thus defined is called "succinite," but
several other resins accompany it even as found in its classical locality
—the Baltic shore of Prussia—and, owing to their viscid condition
before fossilization, may have become mixed with it. One of these is
called "gedanite," and is used for ornamental purposes. It is more
brittle than amber, and contains no succinic acid. It is usually clear
and transparent, and of a pale wine-yellow colour.
It is not possible to be certain about the exact nature of what
appears to be a "piece of amber" thrown up on the seashore, without
chemical examination. A year or two ago a friend brought to me a
dark brownish-yellow-coloured piece of what looked like amber, which
(so my friend stated) had been picked up on the shore at Aldeburgh.
It was as big as three fingers of one's hand, very transparent and
fibrous-looking, owing to the presence of fine bubbles in its substance
arranged in lines. I found an exactly similar piece from the same
locality in the collection of the Natural History Museum. It was
labelled "copal," and, I suppose, had been chemically ascertained to
be that resin and not "amber," or, to use the correct name,
"succinite." How either of these pieces got into the North Sea it is
difficult to say. Though the "copal" of commerce is obtained from the
West Coast of Africa, it may occur (though I have not heard that it
does) associated with true amber in Prussia. A fossilized resin very
similar to copal is found in the London clay at Highgate and
elsewhere near London, and is called "copalite." It is possible, though
not probable, that the bits of amber found on our East Coast beaches
are derived from Tertiary beds, now broken up and submerged in the
North Sea, and do not travel to us all the way from the Baltic.
CHAPTER X

SEA-WORMS AND SEA-ANEMONES

L
ET us now leave the beach-pebbles and go down on to the rocks at
low tide in order to see some of the living curiosities of the
seashore. There are some seaside resorts where, when the tide goes
down, nothing is exposed but a vast acreage of smooth sand, and
here the naturalist must content himself with such spoils as may be
procured by the aid of a shrimping-net and a spade. Wading in the
shallow water and using his net, he will catch, not only the true
"brown shrimp," but other shrimp-like creatures, known as
"crustacea"—a group which includes also the lobsters, hermit-crabs,
true crabs, and sand-hoppers, as well as an immense variety of
almost microscopic water-fleas.
He will also probably catch some of the stiff, queer little "pipe-fish,"
which are closely related to the little creatures known as "sea-
horses." Pipe-fish are very sluggish in movement, almost immobile,
whilst the "sea-horse" or hippocampus—only to be taken by the
dredge amongst corallines in deep water on rocky bottoms (as, for
instance, in the Channel Islands)—goes so far as to curl his tail, like a
South American monkey, round a stem of weed and sit thus upright
amidst the vegetation. Even when disturbed he merely swims very
slowly and with much dignity in the same upright position, gently
propelled by the undulating vibratory movement of his small dorsal
fin. The male in both pipe-fish and sea-horses is provided with a sac-
like structure on the ventral surface in which he carries the eggs laid
by the female until they are hatched.
Fig. 4.—British Marine Worms or Chætopods.

a, Arenicola piscatorum. Lug-worm largely used for bait by sea-fishermen. It


burrows in sea-sand and clay as the earth-worm does in soil. Half the natural
size, linear.
b, Nephthys margaritacea, actively swimming. It also burrows in the sea-sand.
Natural size.
c, Eunice sanguinea, a very handsome marine worm (often used for bait)
which lives in clefts in the submarine rocks and also swims actively. The
numerous filaments on the sides of the ringed body are the gills of a rich
blood-colour. The figure is one-third of the natural size, linear.

The shrimper will probably catch also some very young fish fry—
including young flat-fish about 2 inches long. If he explores the
exposed surface of sand near the low-tide limit, he will find a variety
of indications of burrowing animals hidden beneath. Little coiled
masses like the "castings" of earth-worms are very abundant in
places, and are produced by the fisherman's sand-worm, or "lug-
worm" (Fig. 4, a). A vigorous digging to the depth of a foot or two
will reveal the worm itself, which is worth bringing home in a jar of
sea-water in order to see the beautiful tufts of branched gills on the
sides of the body, which expand and contract with the flow of bright
red blood showing through their delicate walls. Other sand-worms,
from 2 to 6 inches long, will at the same time be turned up,—worms
which have some hundred or more pairs of vibrating legs, or paddles,
arranged down the sides of the body, and swim with a most graceful,
serpentine curving of the mobile body (Fig. 4, b). These sea-worms
are but little known to most people, although they are amongst the
most beautifully coloured and graceful of marine animals. Hundreds
of different kinds have been distinguished and described and pictured
in their natural colours. Each leg is provided with a bundle of bristles
of remarkable shapes, resembling, when seen under a microscope,
the serrated spears of South Sea Islanders and mediaeval warriors.
These worms usually have (like the common earth-worm) red blood
and delicate networks of blood-vessels and gills (Fig. 4, c), whilst the
head is often provided with eyes and feelers. They possess a brain
and a nerve-cord like our spinal cord, and from the mouth many of
them can suddenly protrude an unexpected muscular proboscis
armed with sharp, horny jaws, the bite of which is not to be despised.
These "bristle-worms," or "chætopods," as they are termed by
zoologists, are well worth bringing home and observing in a shallow
basin holding some clean sea-water.
At many spots on our coast (e.g. Sandown, in the Isle of Wight, and
the Channel Islands) rapid digging in the sand at the lowest tides will
result in the capture of sand-eels, a bigger and a smaller kind, from 1
foot to 6 inches in length. These are eel-shaped, silvery fish, which
swim near the shore, but burrow into the soft sand as the tide
recedes. They are excellent eating. We used at Sandown to make up
a party of young people to dig the smaller "sand-eels," or "sand-
launce." The agility and rapid disappearance of the burrowing fish
into the sand when one thought one had safely dug them out,
rendered the pursuit difficult and exciting. Then a wood fire on the
beach, a frying-pan, fat, flour, and salt were brought into operation,
and the sand-eels were cooked to perfection and eaten.
Some of the marks or small heaps of sand on the flats exposed at low
tide are characteristic of certain shell-fish. The "razor-fish" (Fig. 19, b)
—a very much elongated clam, or mussel,
with astonishing powers of rapid
burrowing—leaves a hole on the surface
like a keyhole, about an inch long. It can
be dug up by an energetic spadesman,
but a spoonful of common salt poured
over the opening of its burrow will cause it
to suddenly shoot out on to the surface,
when it may be picked up, and the hunter
spared any violent exertion. The curious
heart-urchin (Fig. 5), as fragile as an egg-
Fig. 5.—The shell of the shell, and covered with long, closely-set
Heart-urchin (Spatangus spines like a brush, is often to be found
purpureus) with its burrowing in the sand, as well as the
spines rubbed off.
One-fourth the actual transparent, pink-coloured worm known as
diameter. Synapta, in the skin of which are set
thousands of minute calcareous anchors
hinged to little sculptured plates. These
burrowers swallow the sand and extract nutriment from stray organic
particles mixed in it.
The mere sand-flat of the low tide is not a bad hunting ground; but
the rock pools, often exposed when the tide is out, and the fissures in
the rocks and the under surfaces of slabs of rock revealed by turning
them over—are the greatest sources of varied delight to the sea-
shore naturalist. It is well to take a man with you on to these rocks to
carry your collecting bottles and cans, and to turn over for you the
larger slabs of loose stone, weighing as much as a couple of
hundredweight. The most striking and beautiful objects in these rock
pools are the sea-anemones (Fig. 6 and Frontispiece). They present
themselves as disk-like flowers from 1 to 5 inches in diameter, with
narrow-pointed petals of every variety of colour, set in a circle around
a coloured centre. The petals are really hollow tentacles distended
with sea-water, and when anything falls on to them or touches them
they contract and draw together towards the centre. The centre has a
transverse opening in it which is the mouth, and leads into a large,
soft-walled stomach, separated by its own wall from a second
spacious cavity lying between that wall and the body wall, and
sending a prolongation into each tentacle. The stomach opens freely
at its deep end into this second "surrounding" chamber, which is
divided by radiating cross walls into smaller partitions, one
corresponding to each tentacle. The nourishing results of digestion,
and not the food itself, pass from the stomach into the subdivided or
"septate" second chamber. There is thus only one cavity in the
animal, separable into a central and a surrounding portion.
In this respect—in having only one body cavity—sea-anemones and
the coral-polyps and the jelly-fishes and the tiny freshwater polyp or
hydra, and the marine compound branching polyps like it—agree with
one another and differ from the vast majority of animals, such as
worms, sea-urchins, star-fishes, whelks, mussels, crustaceans,
insects, spiders and vertebrates (which last include fish, reptiles,
birds, and mammals). These all have a second chamber, or body
cavity, quite shut off from the digestive cavity and from the direct
access of water and food particles. This second distinct chamber is
filled with an animal fluid, the lymph, and is called the "Cœlom" (a
Greek word meaning a cavity). These higher animals, which possess
a cœlom as well as a gut, or digestive cavity, are called "Cœlomata,"
or "Cœlomocœla," in consequence; whilst the sea-anemones, polyps,
and jelly-fish form a lower grade of animals devoid of cœlom, but
having the one cavity, or gut, continued into all parts of the body.
Hence they are called "Cœlentera," or "Enterocœla," words which
mean that the cavity of their bodies (Greek cœl) is made by an
extension of the gut, or digestive cavity (Greek enteron). The higher
grade of animals—the Cœlomocœla—very usually have a vascular
system, or blood-vessels and blood, as well as a cœlom and lymph,
and quite independent of it; also some kind of kidneys, or renal
excretory tubes. Neither of these are possessed by the sea-anemones
and their allies—the Enterocœla—but they have, like higher animals,
a nervous system and also large ovaries and spermaries on the walls
of their single body cavity, which produce their reproductive germs.
These pass to the exterior, usually through the mouth, but sometimes
by rupture of the body wall.
All "one-cavity" animals, the Enterocœla or Cœlentera, produce
peculiar coiled-up threads in their skin in great quantity—many
thousands—often upon special warts or knobs. These coiled-up
threads lie each in a microscopic sac; they are very delicate and
minute and carry a virulent poison, so that they are "stinging"
threads. Excitement of the animal, or mere contact, causes the
microscopic sac to burst, and the thread to be violently ejected. The
sea-anemones, jelly-fish, and polyps feed on fresh living animals,
small fish, shrimps, etc., and catch their prey by the use of these
poisonous threads. Some jelly-fish have them big enough to act upon
the human skin, and bathers are often badly stung by them. The
commonest jelly-fish do not sting, but where they occur a few of the
stinging sort are likely to occur also. Even some sea-anemones can
sting one's hand with these stinging threads. One sea-anemone
(known as "Cerianthus"), occasionally taken in British waters, makes
for itself a leathery tube by the felting of its stinging threads, and
lines its long burrow in the sand below tidal exposure in this way.
The sea-anemones are very hardy, and they are wonderfully varied
and abundant on our coasts. Some sixty years ago a great naturalist,
who loved the seashore and its rock-pools enthusiastically, Mr. Philip
Henry Gosse, father of Mr. Edmund Gosse, the distinguished man of
letters, described our British sea-anemones, and gave beautiful
coloured pictures of them. One of these I have taken for the
frontispiece of this volume, and some of the outline figures of marine
animals in these chapters are borrowed from a marvelously complete
and valuable little book by him—now long out of print—entitled
"Marine Zoology." His books—of high scientific value—and his
example, made sea-anemones "fashionable." London ladies kept
marine aquariums in their drawing-rooms stocked with these
beautiful flowers of the sea. They were exhibited in quantity at the
Zoological Gardens in Regent's Park, and it is by no means a
creditable thing to our London zoologists that neither these nor other
marine creatures are now to be seen there. At a later date public
marine aquaria were started with success in many seaside towns,—
Brighton, Scarborough, Southport, etc.—and a very fine one was
organized in Westminster and another at the Crystal Palace. It is an
interesting and important fact, bearing on the psychology of the
British people, that most of these charming exhibitions of strange and
beautiful creatures from the depths of the sea were very soon
neglected and mismanaged by their proprietors; the tanks were
emptied or filled with river water, and the halls in which they were
placed were re-arranged for the exhibitions of athletes, acrobats,
comic singers, and pretty dancers. These exhibitions are often full of
human interest and beauty—but I regret the complete disappearance
of the fishes and strange submarine animals. I have some hope that
before long we may, at any rate in the gardens in the Regent's Park,
see really fine marine and fresh-water aquaria established, more
beautiful and varied in their contents than those of earlier days.

Fig. 6.—British Sea-Anemones.


a, Sagartia bellis, the daisy anemone, viewed from above when fully
expanded.
b, Bunodes crassicornis, half expanded; side view.
c, Anthea cereus. The tentacles are pale apple-green in colour, tipped with
mauve, and cannot be completely retracted.
d, Actinia mesembryanthemum. The disk of tentacles is completely retracted.
This is the commonest sea-anemone on our South Coast, and is usually
maroon colour, but often is spotted like a strawberry.

There are four kinds of sea-anemones which are abundant on our


coast. They adhere by a disk-like base to the rocks and large stones,
and have the power of swelling themselves out with sea-water (as
have many soft-bodied creatures of this kind), with all their tentacles
expanded. They have, in that condition, the shape of small "Martello"
towers, with their adhesive disk below and the mouth-bearing
platform above, fringed by tapering fingers; and they can, on the
other hand, shrink to a fifth part of their expanded volume, drawing
in and concealing their tentacles, which are in some kinds perforated
at the tip. One common on the rocks at Shanklin and other parts of
our South Coast, but not on the East Coast, has very abundant, long,
pale green tentacles, which are tipped with a brilliant peach colour,
and it is peculiar in not being able to retract or conceal this beautiful
crown of snake-like locks, reminding one of the Gorgon Medusa. It is
known as Anthea cereus (Fig. 6, c). Many of them are known by the
name "Actinia," and the commonest of all (Fig. 6, d) is called "Actinia
mesembryanthemum," because of its resemblance to a fleshy-leaved
flower of that name which grows on garden rockeries—sometimes
called the "ice-plant." This one is of a deep maroon colour, rarely
more than an inch and a half across the disk. The adhesive disk is
often edged with bright blue, and small spherical tentacles, of a
bright blue colour, are set at intervals outside the fringe of longer red
ones. This anemone lives wonderfully well in a small glass basin or in
an aquarium holding a gallon of sea-water, which is kept duly aerated
by squirting it daily. One lived in Edinburgh for more than fifty years,
in the possession first of Sir John Dalyell, and then of Mr. Peach. She
was known as "Granny," and produced many hundreds of young in
the course of years. This species is viviparous, the young issuing from
the parent's mouth as tiny fully-formed sea-anemones, which
immediately fix themselves by their disks to the glass wall of their
habitation. Anemones kept thus in small aquaria have to be carefully
fed; bits of the sea mussel (of course, uncooked) are the best food
for them. This and many other kinds are not absolutely stationary,
but can very slowly crawl by means of muscular movements of the
adhesive disk. There are kinds of sea-anemones known which spend
their lives floating in the ocean; they are thin and flat. Others adhere
to the shells of hermit crabs and even to the big claws of some crabs,
and profit by the "crumbs" of food let fall by the nippers of their host.
A very handsome and large sea-anemone is common on the East
Coast, and is known as "crassicornis" (its generic name is Bunodes).
When distended it measures as much as 4 inches across (Fig. 6, b). I
have one at this moment before me, expanded in a bowl of sea-
water. The tentacles are pale green or grey, banded with deep red,
and the body is blotched with irregular patches of red, green, and
orange. It attaches fine pebbles and bits of shell to the surface of the
body.
CHAPTER XI

CORAL-MAKERS AND JELLY-FISH

A
VERY beautiful kind of sea-anemone (common at Felixstowe) is
the Daisy or Sagartia troglodytes, (Fig. 6, a), which has a very
long body attached to a rock or stone far below the sandy floor of
the pool, on the level of which it expands its thin, long, ray-like
tentacles, coloured dark brown and white, and sometimes orange-
yellow. As soon as you touch it it disappears into the sand, and is
very difficult to dig out. The most beautifully coloured of all sea-
anemones are the little Corynactids (half an inch across), which you
may find dotted about like jewels, each composed of emerald, ruby,
topaz, and creamy pink and lilac, on the under surface of slabs of
rock at very low tide in the Channel Islands. One of the most
puzzling facts in natural history is that these lovely little things live in
the dark. No eye, even of fish or crab, has ever seen what you see
when you turn over that stone. It is a simple demonstration of the
truth of the poet Gray's statement, that many a gem of purest ray
serene is concealed in the dark, unfathomed depths of ocean! A
splendid anemone is the Weymouth Dianthus (see the frontispiece of
this volume), so named because it is dredged up in Weymouth Bay.
It is often six inches long, and has its very numerous, small tentacles
arranged in lobes, or tufts, around the mouth. It is either of a
uniform bright salmon-yellow colour or pure white. When kept in an
aquarium it fixes itself by its disk on the glass wall, and often, as it
slowly moves, allows pieces of the disk to become torn off and
remain sticking to the glass. These detached pieces develop
tentacles and a mouth, and grow to be small and ultimately full-
sized Weymouth anemones.
If the disk were spread out and gave rise to little anemones without
tearing—so that they remained in continuity with the parent—we
should get a composite or compound animal, made up of many
anemones, all connected at the base. This actually happens in a
whole group of polyps resembling the sea-anemones. They grow
into "stocks," "tree-like" or "encrusting" masses, consisting of
hundreds and even thousands of individuals, each with its mouth
and tentacles, but with their inner cavities and bases united. These
are the "coral polyps," or "coral-insects" of old writers, of so many
varied kinds. One further feature of great importance in a "coral" is
the production of a hard deposit of calcite, or limestone, which is
thrown down by the surface of the adhesive disk, and is also formed
in deep, radiating "pockets," pushed in to the soft animal from the
disk. The hard deposit of calcite is continuous throughout the
"stock," or "tree," and when the soft sea-anemone-like animals die,
the hard, white matter is left, and is called "coral." Very commonly
this white coral shows star-like cups on its surface, which correspond
to the lower ends or disks of the soft sea-anemone-like creatures
which deposited the hard coral. In a less common group
(represented commonly on our coast by the so-called "Dead men's
fingers" found growing on the overhanging edges of low-tide rocks)
the hard coral material does not form cups for the minute sea-
anemones which secrete it, but takes the form of a supporting
central or axial rod (sea-pens), or branched tree (sea-bushes), upon
which the fleshy mass of polyps are tightly set. This is the case with
the precious red and pink coral of the Mediterranean (which is now
being "undersold" actually in the Mediterranean markets by a similar
red coral from Japan, usually offered as the genuine article, which it
is not!).
On the British coast you do not, as a rule, find coral-forming polyps.
A small kind, consisting of two or three yellow and orange-red
anemone-polyps united and producing a small group of hard calcite
cups (Caryophyllia and Balanophyllia) is not uncommon at Plymouth
at a few fathoms depth. But you have to go to the Norwegian fiords
or else far out to sea where you have 300 fathoms of sea-water in
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like