100% found this document useful (9 votes)
22 views

Get Getting Started with MariaDB Bartholomew Daniel PDF ebook with Full Chapters Now

Daniel

Uploaded by

zupelculkin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (9 votes)
22 views

Get Getting Started with MariaDB Bartholomew Daniel PDF ebook with Full Chapters Now

Daniel

Uploaded by

zupelculkin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Get ebook downloads in full at ebookmeta.

com

Getting Started with MariaDB Bartholomew Daniel

https://ebookmeta.com/product/getting-started-with-mariadb-
bartholomew-daniel/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Animation For Beginners Getting Started with Animation


Filmmaking Meroz

https://ebookmeta.com/product/animation-for-beginners-getting-started-
with-animation-filmmaking-meroz/

ebookmeta.com

Programming Arduino: Getting Started with Sketches, Third


Edition Simon Monk

https://ebookmeta.com/product/programming-arduino-getting-started-
with-sketches-third-edition-simon-monk/

ebookmeta.com

Make Getting Started with 3D Printing 2nd Edition Liza


Wallach Kloski

https://ebookmeta.com/product/make-getting-started-
with-3d-printing-2nd-edition-liza-wallach-kloski/

ebookmeta.com

Event Planning and Management Ruth Dowson

https://ebookmeta.com/product/event-planning-and-management-ruth-
dowson/

ebookmeta.com
Malcolm McDonald on Marketing Planning Understanding
Marketing Plans and Strategy 2nd Edition Malcolm Mcdonald

https://ebookmeta.com/product/malcolm-mcdonald-on-marketing-planning-
understanding-marketing-plans-and-strategy-2nd-edition-malcolm-
mcdonald/
ebookmeta.com

Marketing Management 5th Edition Dawn Iacobucci

https://ebookmeta.com/product/marketing-management-5th-edition-dawn-
iacobucci/

ebookmeta.com

Lyapunov Inequalities and Applications Ravi P Agarwal


Martin Bohner Abdullah Özbekler

https://ebookmeta.com/product/lyapunov-inequalities-and-applications-
ravi-p-agarwal-martin-bohner-abdullah-ozbekler/

ebookmeta.com

New Syllabus Mathematics Workbook 1 Dr Joseph Yeo

https://ebookmeta.com/product/new-syllabus-mathematics-workbook-1-dr-
joseph-yeo/

ebookmeta.com

Customer Experience Analytics: How Customers Can Better


Guide Your Web and App Design Decisions 1st Edition Akin
Arikan
https://ebookmeta.com/product/customer-experience-analytics-how-
customers-can-better-guide-your-web-and-app-design-decisions-1st-
edition-akin-arikan/
ebookmeta.com
Pro Apache NetBeans: Building Applications on the Rich
Client Platform 1st Edition Ioannis Kostaras

https://ebookmeta.com/product/pro-apache-netbeans-building-
applications-on-the-rich-client-platform-1st-edition-ioannis-kostaras/

ebookmeta.com
www.it-ebooks.info

Getting Started with MariaDB


Learn how to use MariaDB to store your data easily and hassle-free

Daniel Bartholomew

BIRMINGHAM - MUMBAI

www.it-ebooks.info

Getting Started with MariaDB

Copyright © 2013 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: October 2013

Production Reference: 1151013

Published by Packt Publishing Ltd.

Livery Place
35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78216-809-6

www.packtpub.com

Cover Image by Suresh Mogre ([email protected])

www.it-ebooks.info

Credits

Author

Project Coordinator

Daniel Bartholomew

Joel Goveya

Reviewers

Proofreader

P. R. Karthik

Tarsonia Sanghera

Daniel Parnell

Indexers

Stephane Varoqui

Rekha Nair

Acquisition Editor
Mehreen Deshmukh

Rubal Kaur

Production Coordinator

Commissioning Editor

Adonia Jones

Poonam Jain

Cover Work

Technical Editor

Adonia Jones

Sharvari H. Baet

www.it-ebooks.info

About the Author

Daniel Bartholomew has been using Linux since 1997 and


databases since 1998. He has written dozens of articles for various
magazines, including The Linux Journal, Linux Pro, Ubuntu, User and
Tux.

Daniel has been involved with the MariaDB project shortly after it
began in early 2009. He currently works for SkySQL and splits his
time between MariaDB

documentation and maintaining the bits and pieces (including build,


e-mail, web, and other servers) that keep the MariaDB project
running smoothly. In addition to his day-to-day responsibilities,
Daniel also serves as the MariaDB release coordinator and has been
deeply involved with almost every MariaDB release.
He lives in Raleigh, North Carolina, USA with his lovely wife and four
children.

I'd like to thank Amy, Ila, Lizzy, Anthon, and Rachel for their
patience with me throughout the writing of this book. Thanks also to
Vladislav Vaintroub, Sanja Byelkin, Roger Bartholomew, and others
who were very helpful at various points during the project. Lastly, I'd
like to thank Monty and the rest of the MariaDB team for the
excellent database that they've created.

www.it-ebooks.info

About the Reviewers

P. R. Karthik started his career as a MySQL DBA. Currently, he is


working as a Senior MySQL DBA in Yahoo. They are managing one
of the biggest MySQL farms in the world.

I would like to thank my parents and friends for their support with
reviewing this book.

Daniel Parnell lives in Melbourne, Australia. He started messing


around with computers when he was very young. His first computer
was an AIM65 with a 4 K of RAM, BASIC and Forth in ROM, and no
storage. From there, he tinkered with various home computers
ranging from the Apple II to the Commodore Amiga. These days
Daniel works on web and desktop apps. When Daniel is not
programming or tinkering with his latest hardware project, he is
spending time with his wife and two children.

Stephane Varoqui is a senior MariaDB and MySQL consultant at


SkySQL. He is based in Paris. Before joining SkySQL in 2011, he
worked at MySQL/Sun/Oracle as a lead MySQL consultant in the
Europe/Middle East/Africa (EMEA) region for six years.

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

Support files, eBooks, discount offers, and more You might


want to visit www.PacktPub.com for support files and downloads
related to your book.

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 [email protected] 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

http://PacktLib.PacktPub.com

Do you need instant solutions to your IT questions? PacktLib is


Packt's online digital book library. Here, you can access, read and
search across 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 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 nine entirely free books.
Simply use your login credentials for immediate access.

www.it-ebooks.info

Table of Contents

Preface 1

Chapter 1: Installing MariaDB

Choosing a MariaDB series

The development series

The stable series

The maintenance series

Installing MariaDB on Windows

10

Installing MariaDB on Mac OS X

13

Installing MariaDB on Debian, Ubuntu, and Linux Mint


14

Installing MariaDB on Fedora, Red Hat, and CentOS

15

Installing MariaDB on other Linux distributions

17

MariaDB package security

18

After the installation

18

Troubleshooting installation issues

19

Summary 20

Chapter 2: Configuring MariaDB

21

Filesystem layout for MariaDB

21

Filesystem layout for Windows

21

Filesystem layout for Linux

22
Modular configuration on Linux

23

The MariaDB configuration file

25

Comments

25

Groups 26

Options which do not require values

26

Options which require values

27

Options, options everywhere

28

Activating configuration changes

28

Summary 29

www.it-ebooks.info

Table of Contents

Chapter 3: MariaDB Security

31
Securing MariaDB in ten seconds

32

Connecting safely

34

Server security

36

Building security

37

Internal network security

38

Internet security

39

Summary 39

Chapter 4: MariaDB User Account Management

41

User privileges

41

Global administrative privileges

42

Database, table, and column privileges


42

Miscellaneous privileges and limits

43

Creating users

44

Granting permissions

45

Adding and removing privileges

47

Showing grants

47

Changing passwords

48

Removing users

48

Summary

49

Chapter 5: Using MariaDB

51

Running the mysql command-line client


51

Using a database

52

Listing all databases on a server

53

Creating and dropping databases

54

Creating a database

54

Dropping a database

55

Creating, altering, and dropping tables

56

Creating a table

56

Showing the command used to create a table

58

Exploring the structure of a table

59

Altering a table
60

Adding a column

60

Modifying a column

60

Dropping a column

61

Dropping a table

61

Selecting, inserting, updating, and deleting data

61

Inserting data

62

Updating data

63

Deleting data

64

[ ii ]

www.it-ebooks.info

Table of Contents
Reading data

64

Summary 68

Chapter 6: MariaDB Maintenance

69

MariaDB log files

69

The all-important binary log

69

The error log

70

The general query log

71

The slow query log

71

Optimizing and tuning MariaDB

72

Backing up MariaDB

73

Basic backups with mysqldump


Discovering Diverse Content Through
Random Scribd Documents
period a policy of reculer pour mieux sauter, suggesting that her
hand, though hidden, was never really withdrawn from the affairs of
the Forbidden City. To some extent the suggestion is justifiable; but
Tzŭ Hsi’s retirement in the I-Ho Yüan lasted, roughly speaking, for
ten years, during a considerable portion of which period she
undoubtedly ceased to concern herself with affairs of State, other
than those which directly affected the replenishing of her privy purse.
But while divesting herself of the outward and visible signs of
rulership, Tzŭ Hsi had no intention of becoming a negligible quantity,
or of losing touch with current events. From her luxurious retreat at
the foot of the hills which shelter Peking, she could keep close watch
on the doings of the Emperor, and protect the interests of her
personal adherents in the capital and the provinces. Her power of
appointing and dismissing officials, which drew much of its
inspiration from the Chief Eunuch, was never surrendered.
In marrying the Emperor to her favourite niece, Tzŭ Hsi intended
to avoid a repetition of the mistake which she had committed in the
case of her son, the Emperor T’ung-Chih, whose marriage with the
virtuous and courageous A-lu-te had resulted in dangerous intrigues
against herself, until death had removed the offenders. Warned by
this experience, she made her selection in the present instance less
with a view to the Emperor’s felicity than to the furtherance of her
own purposes, which necessitated the presence by his side of
someone who would watch over, and report on, his proceedings and
proclivities. This part her niece played to perfection. In appearance
she was unattractive, and in disposition and temper unsympathetic,
but she possessed a considerable share of the Yehonala intelligence
and strength of will. From the very first she was on bad terms with
the Emperor. It was no secret at Court that they indulged in fierce
and protracted quarrels, in which the young Empress generally came
off victorious. As a natural result, Kuang-Hsü developed and showed
a marked preference for the society of his two senior concubines,
known respectively as the “Pearl” and “Lustrous” consorts.
Upon the Emperor’s assumption of rulership, there was shown a
strong feeling amongst the senior members of the Yehonala clan that
the opportunity should be taken to consolidate its position and power
by conferring on the Emperor’s father rank in the hierarchy higher
than that which he had hitherto held, with a view to his ultimate
canonisation as Emperor. The manner in which this proposal was put
forward, and Tzŭ Hsi’s refusal to act upon it—while giving all
possible “face” to Prince Ch’un—throw light upon one of the
undercurrents of China’s dynastic affairs which are so difficult for
Europeans to follow.
The views of Prince Chun’s adherents were voiced in a Memorial
addressed to the Empress Dowager by Wu Ta-ch’eng, formerly Vice-
President of the Censorate, who at that time held the post of Director
of the Yellow River Conservancy. This Memorial, after referring to the
services rendered by Prince Ch’un as head of the Admiralty, and
praising his patriotism, zeal and extreme modesty, proceeded to
observe that he was, after all, the Emperor’s own father, and, as
such, entitled to higher respect in a Dynasty which “won the Empire
by virtue of its respect for filial piety.” The Memorialist further
recommended that the Son of Heaven should be authorised to grant
special recognition and honour to his parent, on the principle laid
down by Mencius that “the main principle underlying all ceremonies
is that satisfaction should be felt by those concerned.” As usual, the
Memorialist strengthened his request with reference to historical
precedents, and quoted a case, referred to by the Emperor Ch’ien
Lung in his edition of Chu Hsi’s famous historical work, where two
parties in the State under the Sung Dynasty disagreed as to the title
to be accorded to the father of the Emperor (a.d. 1050). In that
instance the opinion of His Majesty Ch’ien-Lung (as a commentator)
was opposed to that of the historians, for he supported the
contention that the Emperor’s father, as a simple matter of filial piety,
is entitled to special honour. He quoted a case where, under the
Ming Dynasty (1525), the Emperor desired to have his father raised
to the rank of Emperor, although he also had been born only to
princely rank; in other words, the Emperor Ch’ien Lung, who is justly
regarded as the highest authority on precedents produced by the
present Dynasty, placed the blood-tie between father and son above
all the theories and conventions that might be raised by courtiers as
to their official relationship. The Memorialist concluded by
recommending that the title of “Imperial father” be given to Prince
Ch’un, and that the Empress Dowager should announce this as the
last act of her rule, so that His Majesty’s filial piety might be fittingly
displayed.
There is every reason to believe that the above Memorial was
inspired in the high quarters immediately concerned, so as to afford
Her Majesty an opportunity for putting on record her own views,
while bestowing great honour on the house of Ch’un. After praising
the Prince and his unswerving loyalty, she continues:—

“Whenever I have wished to bestow any special honour


upon him, he has refused it with tears in his eyes. On one
occasion I granted him permission to ride in a sedan chair
with curtains of apricot yellow[44] silk, but not once has he
ventured to avail himself of this honour. He has thus displayed
his loyalty and unselfish modesty, already well known to my
people as well as to myself.
“Years ago, in the first month of the present reign, the
Prince put in a secret Memorial, in which, after reciting
numerous precedents, he expressed a fear that the very
example which has now been cited by the present Memoralist
(Wu Ta-ch’eng) might be used by sycophants and other evil
persons to advance improper proposals on his behalf. For this
reason he handed in his secret Memorial in advance, with a
request that, when the Emperor should attain his majority, no
change whatsoever should be made in his own rank and
titles. Never was there a more brilliant example of devoted
service by a Minister of the Crown, and, while heartily praising
him, I yielded reluctantly to his request. Now that I am about
to hand over the reins of Government, the very thing that
Prince Ch’un feared has come to pass, and I therefore feel
bound to take this occasion to publish to the world his original
Memorial, so that none may hope to work mischief by any
further proposals of a similar kind, and that this worthy
Prince’s sincerity, thus manifested, may become an example
for all to follow.”
Prince Ch’un’s original Memorial, dated 1875, is of no particular
interest except in that it reveals, even at that date, a sense of the
dangers arising from the confusion of the Imperial succession and
considerable anxiety as to the future adjustment of the situation. His
own object in declining further honours was clearly stated to be that
he wished to prevent sycophants and persons of doubtful loyalty
from establishing claims upon him or forming a party in the
Forbidden City, which (it may be observed) has actually come to
pass. He deplored the possibility that when His Majesty the Emperor
begins to rule in person, “officials of obscure origin may be led to
think that, by artful and treasonable suggestions, they may delude
His Majesty and thus rise to high office by creating opportunities of
dissension.”
The rank of the Emperor’s father therefore remained that of an
hereditary Prince, but there is no doubt that the matter is by no
means disposed of, and may possibly be revived upon the
conclusion of the present Regent’s term of office.[45]
Shortly after Tzŭ Hsi’s retirement from public affairs the Emperor’s
father, Prince Ch’un, fell ill of a sickness which increased until, on 1st
January 1891, he died. In 1890, the Censorate, deeply concerned for
a strict observance of the laws and ceremonial etiquette of filial piety,
took occasion, in a Memorial of remonstrance, to draw Her Majesty’s
attention to her duty, and that of the Emperor, of visiting the invalid.
Tzŭ Hsi’s reply took the form of a rebuke to the Censors, whom she
bluntly directed to mind their own business, in a manner which
forcibly brings to mind Queen Elizabeth’s methods of dealing with
similar remonstrances. Nevertheless she took the hint and
thenceforward, throughout the summer of 1890, she paid repeated
visits to Prince Ch’un’s bedside.
This Prince had always been a favourite with Tzŭ Hsi, who greatly
preferred him to his elder brothers; she regretted his death and felt
the loss of his wise and fearless counsel, which had often guided her
policy. He was a staunch Manchu, jealous of the power and
privileges of the Clans, and will long be remembered in Chinese
history for the remark which he made at a meeting of the Council
after the campaign in Tongking. “It were better,” said he, “to hand
over the Empire to the foreign devils, than to surrender it at the
dictation of these Chinese rebels,” a remark which was prompted by
the growing discontent of the province of Canton against the
Manchus and their rule.

Interior of the Tai Ho Tien.


This Palace is used only for occasions of high ceremony, such as Imperial birthday
celebrations.

Photo, Ogawa, Tokio.

In her Decree recording the Prince’s death and praising his


eminent services as Chamberlain of the Palace, Head of the
Navy[46] and Commander of the Manchu Field Force, Tzŭ Hsi gave
detailed instructions for the mourning and funeral ceremonies,
donating in her own name a Tibetan prayer coverlet for the body.
She conferred upon him the somewhat obvious (but according to
Chinese ideas, highly honourable) title of “deceased father of the
Emperor” and ordered that the funeral should be upon a scale “which
shall simultaneously display His Majesty’s favour and his sense of
filial piety,” due care being taken at the same time not to outrage the
deceased’s conspicuous modesty. By these means, which were in
accordance with her guiding principle of the “happy mean,” she
hoped to set at rest all question of “usurping tendencies” and to
reassure the Aisin Gioros as to their fears of the undue ambition of
the house of Ch’un. Finally, in accordance with the precedent
established by the Emperor Ch’ien-Lung, she decreed that the late
Prince’s residence should be divided into two portions, one to be set
aside as his own ancestral Hall and the other as a shrine (it being
the birthplace) of his Majesty Kuang-Hsü.
In 1894 the Empress Dowager reached her sixtieth year, which,
according to Chinese ideas, is an event calling for special
thanksgiving and honour. Secure in her great and increasing
popularity, safely entrenched in her prestige and influence, the Old
Buddha had expected to devote her leisure at the Summer Palace to
preparations for celebrating this anniversary on a scale of
unparalleled magnificence. The I-Ho Yüan, as the Summer Palace is
called,[47] had been entirely rebuilt, by the Emperor’s orders, with
funds taken from the Navy Department and other Government
Boards since 1889, and had just been completed. Most of the high
provincial authorities had been summoned to the capital to take part
in these festivities (and, incidentally, to help to pay for them), and
amongst them the faithful Jung Lu returned once more to his
mistress’s side, in high favour, as General in command of the Forces
at Peking. (For the last three years he had been at Hsi-an, holding
the sinecure post of Tartar General.) Every high official in the Empire
had been “invited” to contribute twenty-five per cent. of his salary as
a birthday gift to Her Majesty, and the total amount of these offerings
must have amounted to several millions of taels. Everything pointed
to festivities of great splendour; orders had already been given for
the erection of triumphal arches in her honour throughout the whole
five miles of the Imperial highway between Peking and the Summer
Palace, when the continued disasters which overtook China’s forces,
immediately after the outbreak of the war with Japan, caused Her
Majesty to reconsider the situation, and eventually to cancel all
arrangements for the celebration. In the Emperor’s name she issued
the following somewhat pathetic Decree:—

“The auspicious occasion of my sixtieth birthday, occurring


in the 10th Moon of this year, was to have been a joyful event,
in which the whole nation would unite in paying to me loyal
and dutiful homage. It had been intended that His Majesty the
Emperor, accompanied by the whole Court, should proceed to
offer congratulations to me, and make obeisance at the
Summer Palace, and my officials and people have subscribed
funds wherewith to raise triumphal arches, and to decorate
the Imperial highway throughout its entire length from Peking
to the I-Ho Yüan; high altars have been erected where
Buddhist Sutras were to have been recited in my honour. I
was not disposed to be unduly obstinate and to insist on
refusing these honours, because, at the time that the
celebration was planned, my people were enjoying peace and
prosperity; moreover, there is precedent for such displays of
pageantry and rejoicing in the occasions on which the
Emperors K’ang-Hsi and Ch’ien-Lung celebrated their sixtieth
birthdays. I, therefore, consented to His Majesty’s filial
request, and decided to receive birthday congratulations at
the Summer Palace. Who would ever have anticipated that
the Japanese (literally, ‘dwarf men’) would have dared to force
us into hostilities, and that since the beginning of the summer
they have invaded our tributary State (Corea) and destroyed
our fleet? We had no alternative but to draw the sword and to
commence a punitive campaign; at this moment our armies
are pressing to the front. The people of both nations (China
and Corea) are now involved in all the horrors of war, and I
am continually haunted by the thought of their distress;
therefore, I have issued a grant of three million taels from my
privy purse for the maintenance and relief of our troops at the
front.
“Although the date of my birthday is drawing close, how
could I have the heart, at such a time, to delight my senses
with revelries, or to receive from my subjects congratulations
which could only be sincere if we had won a glorious victory?
I therefore decree that the ceremonies to be observed on my
birthday shall be performed at the Palace in Peking, and all
preparations at the Summer Palace shall be abandoned
forthwith. The words of the Empress.”

To which the Emperor adds the filial remark on his own account:
“That Her Majesty had acted in accordance with the admirable virtue
which always distinguished her, and that, in spite of his own wishes,
he was bound reverently to obey her orders in the matter.”
China’s complete and ignominious defeat by the Japanese forces
undoubtedly inflicted no small loss of prestige on the Manchu
Dynasty, and was a direct cause of the violent agitation of the
Southern Provinces for reform, which led in turn to the coup d’état
and to the Boxer rising. It is doubtful whether war could have been
avoided without even greater sacrifices and humiliation, and the
Empress Dowager showed her usual sagacity therefore in refraining
from expressing any opinion or taking any share of responsibility in
the decision taken by the Emperor. She knew, moreover, that, by the
action and advice of her Chief Eunuch, the Navy had for years been
starved in order to provide her with funds to rebuild and decorate the
Summer Palace, a fact of which some of China’s most distinguished
advisers were at that time unaware.
As Viceroy of the Metropolitan Province, Li Hung-chang was
generally blamed for advising the Court to maintain China’s
suzerainty over Corea by force of arms, but, speaking from personal
knowledge of this subject, we may state that, like many other
Ministers similarly situated, he hesitated until the very last moment
before taking risks which he knew to be enormous in both directions.
The documents upon which history might have been written with full
knowledge of the facts were unfortunately destroyed in the Viceroy’s
Yamên at Tientsin and in the Inspector-General of Customs’ quarters
at Peking, in 1900, so that the immediate causes of that disastrous
war will probably never be established with complete accuracy. Li
Hung-chang was aware that twice already Japan had been bought
off from a war of aggression against China, the first time (in 1874) by
payment of an indemnity, and again (in 1885) by admitting her to a
share in the control of Corea, a concession which had led directly to
the present crisis. He realised that even had he been willing to
surrender China’s rights over Corea (which were of no real
advantage to the Chinese Government) the concession might have
purchased peace for the time being, but it would certainly have led
before long to the loss of the Manchurian Provinces; just as certainly,
in fact, as the doom of those provinces was sealed in 1905, on the
day that China acquiesced in the terms of the Portsmouth Treaty.
Japan’s attack on China’s positions was diplomatically as
unjustifiable as the methods which she adopted in commencing
hostilities. Li Hung-chang was fully aware of the preparations that
Japan had been making for years, and equally aware of the
disorganised state of his own naval and military resources, but he
was surrounded by officials who, like the Manchus in 1900, were
convinced of China’s immense superiority, and he was assured by
the Chinese Resident in Corea (Yüan Shih-k’ai) that help would be
forthcoming from England in the event of Japan’s commencing
hostilities. There was no doubt of the British Government’s
sympathy, which was clearly reflected in the attitude and actions of
the Consul-General at Seoul.[48]
Chinese historians have openly accused Li Hung-chang of
instigating the Court and the Emperor to a war of aggression, and
the accusation has been generally credited abroad. The truth is, that
while Li was originally all in favour of sending a Chinese force to
suppress the Corean insurrection, he became opposed to taking any
steps that might lead to war with Japan, as soon as he realised that
war was Japan’s object; nevertheless, it is certain that, in the last
instance, he was persuaded against his better judgment by the
military enthusiasm of his German advisers, and that the sending of
the ill-fated “Kow-hsing” and her doomed crew to Corea was a step
which he authorised only after consultation with Peking and in full
knowledge of the fact that it meant war. No sooner had the “Kow-
hsing” been sunk, and the first military disasters of the campaign
reported, than he naturally endeavoured to minimise his own share
of responsibility in the matter.
Foreigners blamed him for making war on Japan, while his own
countrymen attacked him for betraying China to the Japanese, as
they subsequently attacked him for selling Manchuria to Russia. Tzŭ
Hsi had no great love for the Viceroy, although she admired his
remarkable intelligence and adroit methods: but when, after the war,
he was fiercely attacked by several of the Censors, and when she
found her own name associated with the blame imputed to him, she
loyally defended him, as was her wont. In 1895, a Censor named An
Wei-chün boldly blamed Her Majesty and the Viceroy for the
disasters which had overtaken China. He said:—

“Li Hung-chang has invariably advanced himself because of


his relations with foreigners, and thus been led to conceive an
inflated opinion of his own merits. The ‘dwarf bandits’[49]
having rebelled, he seems to have been afraid that the large
sums of money, saved from numerous peculations, which he
had deposited in Japan might be lost; hence his objections to
the war. When the Decree declaring war reached him, his
disappointment was great, and he showed his resentment
and treachery by supplying the ‘dwarf bandits’ with supplies
and munitions of war. His only hope was that the ‘dwarfs’
would prove victorious and his prophecy would thus be
justified; to this end he curtailed the supplies for our troops at
the front, diverting the funds for the same to his own pockets.
He would strongly oppose all those who urged a vigorous
prosecution of the campaign, rejoicing at our defeats and
deploring our successes. All the military commanders of the
forces under his orders humbly complied with his wishes, and
invariably ran away at the first sight of the enemy. The
Censorate has been full of Memorials denouncing the
treacherous and unpatriotic action of Li Hung-chang, so that
there is no need for me to say anything further on this subject.
“But I would like to add that Generals Yeh and Wei, who
have been cashiered and whose arrest has been decreed,
are at this very moment in hiding at Tientsin; they have made
the Viceroy’s Yamên itself a place of refuge for absconding
criminals. This is a matter of common knowledge and
undoubtedly true. Then again we have the case of Ting Ju-
chang, who was ordered to be arrested, but who persuaded Li
Hung-chang to intercede for him, on the plea that he was
indispensable to China, being in possession of a mysterious
secret, an American invention which he alone could
manipulate, whereby all surrounding objects can be rendered
invisible. Li Hung-chang actually had the audacity to make
mention of this ridiculous invention in addressing your
Majesty, and it seems to me that if he is to be permitted to
refer to fables and unclean magic of this kind, he is treating
the Throne with shameless disrespect. Nevertheless, none of
your Majesty’s Councillors have ever dared to oppose him,
possibly because they themselves are too far gone in senile
decay to be able to bear any further burden of distress. Their
thoughts are far away, wool-gathering, or it may be that they
too have been smitten with fear at the thought of this
marvellous invention of Li Hung-chang’s whereby the
landscape may be completely befogged. If so, the fact would
account for the nebulous tendencies of their policy, and for
their remaining in ignorance of Li Hung-chang’s remarkable
mendacity.
“The Imperial Decree whereby Shao Yu-lien and Chang
Yin-huan have been appointed Plenipotentiaries to discuss
terms of peace, has not yet been made public, because the
Grand Council are actually afraid openly to mention the word
peace, notwithstanding that they failed utterly in prosecuting
the war and in dignified insistence on our lawful rights. Their
action appears to me like that of a thief who having stolen a
bell, shuts his ears while carrying it away, blissfully forgetting
that everybody else can hear its tinkling. They do not seem to
be aware, these Councillors, that throughout the whole
Empire everybody is already aware of the fact that we are
suing for peace. Japan having objected to Shao on personal
grounds, the Grand Council has now actually gone so far as
to suggest that in his place Li Hung-chang’s son, Li Ching-
fang[50] should be appointed. This is simply an outrage. Li
Ching-fang is nothing more than the son-in-law of a Japanese
traitor who calls himself Chang Pang-chang, a man whom I
have already impeached. If such unspeakable traitors are
permitted to go to Japan, nothing will suit the Japanese better,
and the negotiations must inevitably result in our being badly
cheated by these pernicious robbers. Japan’s strength is
purely superficial; as a matter of fact, she is rotten to the core;
if now we are debarred from compelling Japan to fight a
decisive battle, if we meekly accept terms dictated by these
low-born dwarfs, we are simply in the position of a tributary
State, and cannot be described as equals in any treaty that
may be made. In other words, our glorious Empire is not only
being ruined by muddlers, but sold by traitors. There is not a
single subject of the Throne who does not gnash his teeth
with rage, and long to sink them in the flesh of Li Hung-chang.
“There are not lacking people who declare that this
humiliating policy of peace has been prompted by the
Empress Dowager’s Chief Eunuch, Li Lien-ying. For myself, I
do not care to attach undue importance to tea-house gossip,
but as the Empress Dowager has now handed over the reins
of Government to your Majesty, how can you possibly justify
your position before your ancestors and to your subjects, if
you permit her still to dictate to you, or to interfere in the
business of the State? What sort of a person is this Li Lien-
ying who dares to interfere in Government matters? If there
be any truth whatsoever in the rumour, it is assuredly
incumbent upon your Majesty to inflict severe punishment on
this creature, if only because of that House-law of your
Dynasty which forbids eunuchs to concern themselves in
State affairs.
“The truth is that the Throne has been intimidated by Li
Hung-chang, and has taken his statements for granted, while
the Grand Council, chiefly composed of Li’s humble and
obedient servants, shields him from detection and
punishment, fearing that, if thwarted, he may raise the
standard of rebellion. They accordingly do their best to justify
him in the eyes of your Majesty, failing to realise that he has
always been a traitor at heart. His is the will, if not the power,
to rebel. His army is composed of corrupt and useless
creatures quite devoid of any military knowledge or instincts,
while his troops are ever on the verge of mutiny, because they
are always defrauded of their pay. They are quite deficient in
esprit de corps, and the small foreign forces lately organised
at Tientsin would more than suffice to overcome Li Hung-
chang and all his host. The truth of these statements can
easily be verified. Long ago, if he had had the power, he
would surely have rebelled; but as he cannot do so, he
contents himself with bullying your Majesty and disregarding
your Imperial Decrees. He totally ignores the existence of the
Empress Dowager and of your Majesty, a fact which may be
inferred from his daring to insult your intelligence with his
mysterious powers of conferring invisibility.
“I am covered with shame and amazement. My only hope is
that your Majesty will now display the majesty of your wrath,
and, after disclosing Li Hung-chang’s treason to all men, will
put this traitor to death. By this means our troops would at
once be inspired to valour, and the ‘dwarf bandits’ would be
completely annihilated. At the same time, I would ask you to
be so good as to behead me also, as a fitting punishment for
this plain speaking. Your Majesty’s Imperial ancestors are
present in the spirit, and they bear me witness. I am quite
easy in my mind as to the issue, and I therefore lay bare the
innermost thoughts of my heart and lay them before your
Majesty, anxiously begging for your Imperial decision.”

In reply to this outspoken document, the Emperor issued the


following Decree, which bears unmistakable signs of Tzŭ Hsi’s hand.
The attack upon her favourite, Li Lien-ying, was in itself sufficient to
bring her to the front, and there is no doubt that at the time she was
keeping very close watch on the Emperor’s proceedings, and
regularly perusing all State papers.

“Owing to the seriousness of recent events, we have been


particularly anxious of late to receive and attend to the
unprejudiced suggestions of our Censors, and we have
abstained from punishing any of them, even when they have
made use of improper expressions in addressing us. With the
gracious consent of Her Majesty the Empress Dowager, we
have given particular attention to all projects whereby the
welfare of our people may be advanced, and all our people
must by this time be aware of our sincere desire to promote
good Government. In spite of this the Censor, An Wei-chün,
has to-day submitted a Memorial based entirely upon
rumours, and containing the following sentence:—‘How can
you possibly justify your position before your ancestors and to
your subjects if you permit the Empress Dowager still to
dictate to you, or to interfere in the business of the State?’
“Language of this kind reveals depths of audacity
unspeakable, the unbridled licence of a madman’s tongue.
Were we to fail in inflicting stern punishment in a case of this
kind, the result might well be to produce estrangement
between Her Majesty the Empress and ourselves. The
Censor is, therefore, dismissed from office and sentenced to
banishment at the post-roads, on the western frontier where
he shall expiate his guilt and serve as a wholesome warning
to others. His Memorial is handed back to him with the
contempt it deserves.”

Tzŭ Hsi felt deeply the humiliation of her country’s defeat by the
Japanese, a race which, as Chinese historians never fail to remind
themselves, took its first lessons in civilisation and culture from
Chinese scholars and artists. Anxious at all costs to avoid another
invasion of Chihli by the conquerors, she approved the Treaty of
Peace, especially when assured by Li Hung-chang that Russia and
her Continental allies would not allow Japan to annex any portion of
the Manchurian Provinces. As above stated, she declined to permit
Li to be made a scapegoat either by her chagrined Manchu kinsmen
or by his fierce critics in the south, for she recognised the difficulty of
his position, and the fact that he was not directly responsible for the
deplorable condition of China’s defences. But, woman-like, she had
to blame someone for the disasters that had deprived her and her
capital of festivities whose splendour should have gone down,
making her name glorious, to all posterity; and it was not surprising,
therefore, if she heaped reproaches on the Emperor for entering
upon so disastrous a war without her full knowledge and consent. It
was at this time that began the estrangement which thenceforward
gradually grew into the open hostility and secret plottings of 1898,
the long bitterness between Tzŭ Hsi and her nephew which was to
divide the Palace into camps of strife, and to cease only with their
death. From this time also, as they aver who were in close touch with
the life of the Court, the Emperor’s Consort,[51] Tzŭ Hsi’s niece,
became openly alienated from him, and their relations grew more
severely strained as his reform tendencies developed and took
shape. From 1894 to 1896 there was no noticeable change in the
attitude of the Emperor to his august aunt, nor any diminution of his
respectful attentions, but the man in the street knew well, as he
always knows in China, of the rift in the lute, and when, in 1896, the
Emperor’s mother (Tzŭ’s sister) died, it was realised that the last
bond of amity and possible reconciliation between Kuang-Hsü and
the Empress Dowager had been severed.
XII
THE REFORM MOVEMENT OF 1898

At the beginning of 1898 the Grand Council was composed of the


following officials: Prince Kung, the Emperor’s uncle, Prince Li,
whose son was married to Jung Lu’s daughter, Kang Yi,[52] Liao
Shou-heng and Weng T’ung-ho, the Grand Secretary and ex-tutor to
the Emperor. The Empress Dowager was still leading her life of
dignified leisure at the Summer Palace, generally in company with
her two confidential friends, the wife of Jung Lu and her adopted
daughter, the Princess Imperial. By all accounts she was amusing
herself with picnics on the K’un Ming lake, elaborate theatrical
performances and excursions to the neighbouring temples and hill
shrines, devoting her leisure from these pursuits to verse-making
and painting, but keeping herself fully informed, through Kang Yi and
Prince Li, of all that took place in the Forbidden City. Although
leaving the conduct of State affairs to the Emperor, she occasionally
visited the city for a day or two, while the Emperor, on his side,
punctiliously repaired to the Summer Palace five or six times a
month to pay his respects to the Old Buddha. Their relations at this
period were outwardly friendly. Kuang-Hsü never failed to consult
Her Majesty before the issue of any important Decree, and Tzŭ Hsi
was usually most cordial in her manner towards him. She had, it is
true, occasion to reprove him more than once on account of reports
which reached her, through the eunuchs, of his violent temper and
alleged bad treatment of his attendants, reports which were probably
instigated and exaggerated by Li Lien-ying for his own purposes. But
Kuang-Hsü, as events subsequently proved, was fully aware of the
iron hand in the velvet glove. Whenever the Empress came to
Peking, he obeyed strictly the etiquette which required him reverently
to kneel at the Palace gates to welcome her. When visiting her at the
Summer Palace, he was not permitted to announce his arrival in
person, but was obliged to kneel at the inner gate and there await
the summons of admission from the Chief Eunuch. Li, who hated
him, delighted in keeping him waiting, sometimes as much as half an
hour, before informing the Old Buddha of his presence. At each of
these visits he was compelled, like any of the Palace officials, to pay
his way by large fees to the eunuchs in attendance on Her Majesty,
and as a matter of fact, these myrmidons treated him with
considerably less respect than they showed to many high Manchu
dignitaries. Within the Palace precincts, the Son of Heaven was
indeed regarded as of little account, so that the initiative and
determination which he displayed during the hundred days of reform
in the summer of 1898 came as a disturbing surprise to many at
Court and showed that, given an opportunity, he was not wholly
unworthy of the Yehonala blood of his mother, Tzŭ Hsi’s sister.
The official who had hitherto exercised most influence over the
Emperor was Weng T’ung-ho, the Imperial tutor. He had only
rejoined the Grand Council in November 1894, at the critical time
when the disastrous opening of the war with Japan had brought
about the dismissal of the former Council; but as Imperial tutor he
had had the entrée of the Palace ever since the Emperor was five
years old. He was the leader of the southern party in the capital. A
native of Kiangsu (the birthplace of all the greatest scholars of China
during the present Dynasty, and the centre of national culture), he
hated the narrow conservatism of the Manchus, and included in his
dislike the Chinese of the Metropolitan Provinces, whose politics and
point of view are very similar to those of the Manchus. The strife
between north and south really dated from the beginning of Kuang-
Hsü’s reign. The two protagonists on the northern side were Hsü
T’ung, a well-educated Chinese Bannerman (for all practical
purposes, a Manchu at heart) who had been tutor to the Emperor
T’ung-Chih; and Li Hung-tsao, a native of Chihli, who had joined the
Grand Council at the same time as Weng T’ung-ho. The southern
party was led by Weng T’ung-ho and P’an Tsu-yin, the latter a native
of Soochow and a most brilliant scholar and essayist. It is necessary
to dwell on this party strife and its development, because it was the
first cause of the reform movement of 1898, of the subsequent
resumption of the Regency by Tzŭ Hsi, and, eventually, of the Boxer
rising.
For more than twenty years these four high officials had been
colleagues in Peking, meeting one another constantly in social as
well as official circles. Their literary arguments, in which the quick-
witted southerners generally scored, were the talk of the capital. All
four men bore good reputations for integrity, so that literary
graduates entering official life were glad to become their protégés;
but the adherents of the southern party were the more numerous.
This fact aroused the jealousy of Li and Hsü, which grew until it
found vent publicly at the metropolitan examination for the “Chin
Shih,” or Doctor’s, degree in 1899, on which occasion Li was Grand
Examiner and P’an Tsu-yin his chief Associate. P’an, whose duty it
was to select the best essays, recommended a native of Kiangsu for
the high honour of optimus, but Li declined to endorse his decision,
and gave the award to a Chihli man. P’an thereupon openly accused
Li of prejudice and unfairness towards the southerner, and twitted
him besides on his second-rate scholarship.
At the time of Russia’s seizure of Ili, in 1880, Hsü T’ung and Weng
T’ung-ho were respectively Presidents of the Boards of Ceremonies
and Works. At a conference of the highest officials, held in the
Palace, Weng declared himself in favour of war with Russia, but
Hsü, after promising to support him, left him in the lurch at the last
moment, causing him discomfiture and loss of face. Hence, bitter
enmity between them, which increased in intensity when they
became the leaders of the rival factions. Weng was also on bad
terms with Jung Lu, who had never forgiven him for the part he
played in 1880, when Weng denounced his impious liaison to the
Empress Dowager and brought about his dismissal. Jung Lu, as a
loyal Manchu, naturally favoured the northern faction and his
personal feelings prompted him in the same direction.
The enmity between the rival parties increased steadily in the early
nineties, and when Li and Weng were appointed to the Grand
Council, in 1894, the Court itself became involved in their strife, the
Empress siding with the north and the Emperor with the south. At
that time people were wont to speak of the Li faction and the Weng
faction, but later they came to be known as the Empress Dowager’s
party, irreverently nicknamed the “Old Mother set,” and the
Emperor’s party, or “Small Lad’s set.” Both P’an and Li died in 1897.
It was after the latter’s death that Hsü T’ung began to instigate
secret and sinister designs against the Emperor, whom he called a
Chinese traitor. Hsü T’ung, having been tutor to T’ung-Chih, naturally
enjoyed considerable influence with the Empress, but Kuang-Hsü
flatly refused to have him on the Grand Council. So great was his
dislike for the old man that he only received him once in audience
between 1887 and 1898. Hsü had a valuable ally in Kang Yi, who
hated all Chinese, southerners and northerners alike, and whose
influence was used effectively to sow dissension between Tzŭ Hsi
and the Emperor. In 1897, Kang Yi urged the Emperor to give orders
that the Manchu troops should be efficiently trained and equipped.
Kuang-Hsü replied: “You persist, it seems, in the exploded idea that
the Manchu soldiery are good fighting men. I tell you that they are
absolutely useless.” Kang Yi, highly incensed, promptly informed the
Old Buddha and the Iron-capped Princes that the Emperor was the
enemy of all Manchus, and was plotting to appoint Chinese to all
high offices, a statement which naturally created a strong feeling
against His Majesty at Court.
Even the foreign policy of the Empire felt the effects of this rivalry
of the opposing parties in the capital. The Empress, the Manchus,
and the Chinese Bannermen were in favour of coming to an
understanding with Russia, while the Emperor, Weng, and the
southern Chinese, inclined to a rapprochement with Japan, with a
view to imitation of that country’s successful reforms. Li Hung-chang
counted for little at the time, the fact being that, owing to his alleged
responsibility for the war with Japan, his opinions were at a discount;
but such influence as he had was used against the Emperor’s party.
Prince Kung, the doyen of the Imperial family, to whose ripe
judgment the Empress herself would yield at times, was the only
high Manchu to maintain friendly relations with the Chinese party. A
fine scholar himself, he had always admired Weng T’ung-ho’s literary
gifts; the war with Japan had been none of his seeking, and he had
been recalled to the Grand Council, at the same time as Weng, after
a retirement of fourteen years.
The fact is not generally known that Weng T’ung-ho was most
anxious at this time to be sent as Special Envoy to the coronation of
the Czar, for the reason that, realising the Empress Dowager’s
growing hostility towards himself, he wished to be out of harm’s way
in the crisis which he felt to be impending. By a Decree of 1895,
Weng had been “excused from further attendance to instruct His
Majesty at the Palace of Happy Education,” so that he could no
longer influence His Majesty, as heretofore, at all times and seasons,
and his rivals were thus enabled successfully to misrepresent him.
Prince Kung, the head of the Grand Council, went on sick furlough
at the beginning of 1898, afflicted with incurable lung and heart
complaints. The Emperor accompanied the Empress Dowager on
three occasions to visit him at his residence, and ordered the
Imperial physicians to attend him. On the 10th day of the 4th Moon
he died, and the following Decree was issued by Tzŭ Hsi:—

“Prince Kung (Yi Hsin) was my near kinsman; for many


years he has assisted in my Privy Councils. When, with my
colleague, the deceased Empress Tzŭ An, I assumed the
Regency at the beginning of the late Emperor’s reign, the
coast provinces were in rebellion and the Empire in danger,
Prince Kung ably assisted me in restoring order; and I then
bestowed upon him high honours commensurate with his
services. For over thirty years he has supported me with
unswerving loyalty, although for part of that time he took no
part in the business of the State. Again I recalled him to the
Council, where he has ever done yeoman service, despite
many and great difficulties. Of late his old sickness came
upon him again, and I therefore went repeatedly with the
Emperor to visit him, hoping for his fortunate recovery. Of a
sudden, yesterday, he passed away, and thus, at this time of
need, a trusty adviser is lost to me. How describe my grief?
To-day I have visited his residence, there to make oblations.
In the remembrance of bygone days I am completely
overcome. I now bestow on him the posthumous title of
‘Loyal,’ I command that seasonal sacrifices be offered to his

You might also like