Skip to Main Content
Linux Server Security, Second Edition
book

Linux Server Security, Second Edition

by Michael D. Bauer
January 2005
Intermediate to advanced content levelIntermediate to advanced
544 pages
23h 44m
English
O'Reilly Media, Inc.
Content preview from Linux Server Security, Second Edition
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
242
|
Chapter 8: Database Security
If you need to run MySQL as root for some reason, you can chroot the server to help
contain a successful attack. To conserve space and avoid work here, I’ll refer you to
the article at http://www.securityfocus.com/infocus/1726.
Files
Table 8-1 shows where a Red Hat RPM installation puts things. As with any type of
server, file location and ownership can affect security. A little later, I’ll talk about
these files and settings in the my.cnf configuration file(s).
Setting the MySQL root User Password
MySQL account names look like Unix account names, but they are not related. In
particular, MySQL root is the all-powerful MySQL account but has nothing to do
with Linux root. If you try to access MySQL without providing a name, it tries your
Linux account name as the MySQL account name. So, if the Linux root user types:
# mysql
it’s the same as anyone else typing:
% mysql -u root
The initial configuration of MySQL is wide open. If you can get in with:
% mysql -u root
then you need to create a MySQL root password. To set it to newpassword:
mysqladmin -u root password newpassword
You really shouldn’t use the Linux root password as the MySQL root password.
You can even change the name of the MySQL root account, to trip up attackers who
might try to crack its password: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux: Powerful Server Administration

Linux: Powerful Server Administration

Uday Sawant, Oliver Pelz, Jonathan Hobson, William Leemans
Linux Server Hacks

Linux Server Hacks

Rob Flickenger
Linux Server Hacks, Volume Two

Linux Server Hacks, Volume Two

William von Hagen, Brian K. Jones

Publisher Resources

ISBN: 0596006705Supplemental ContentCatalog PageErrata