Database Reference
In-Depth Information
Post-Installation
After you'vefinished installing MySQL or MariaDB on your server, you should perform a
few tasks before allowing others to begin using the service. You may want to change the
server's default behavior by making changes to the configuration file. At a minimum, you
should change the password for the database administrator, root , and add some nonadmin-
istrative users. Some versions of MySQL have some anonymous users initially, and you
should delete them. This section will explain these tasks.
Although the creators of MySQL and MariaDB have set the server daemon to the recom-
mended configuration, you may want to change one or more settings. For instance, you
may want to turn on error logging.
Special Configuration
To enable error loggingand other such settings, you will need to edit the main configura-
tion file for MySQL. On Unix-like systems, this file is /etc/my.cnf . On Windows systems,
the main configuration file is usually either c:\windows\my.ini or c:\my.cnf . The configura-
tion file is a text file that you can edit with a plain-text editor — don't use a word pro-
cessor, as it will introduce hidden binary characters that will cause problems.
The configuration file is organized into sections or groups under a heading name contained
within square brackets. For instance, settings for the server daemon, mysqld , are listed un-
der the group heading, [mysqld] . Under this heading you could add something like log
= /var/log/mysql to enable logging and to set the directory for the log files. You can
list many options in the file for a particular group. Here is an example of how a server con-
figuration file might look:
[mysqld]
datadir=/data/mysql
user=mysql
default-character-set=utf8
log-bin=/data/mysql/logs/binary_log
max_allowed_packet=512M
[mysqld_safe]
ulimit -d 256000
ledir=/usr/sbin
mysqld=mysqld
log-error=/var/log/mysqld.log
pid-file=/data/mysql/mysqld.pid
Search WWH ::




Custom Search