Database Reference
In-Depth Information
chown -R mysql /usr/local/mysql
chgrp -R mysql /usr/local/mysql
The first command changes to the directory containing MySQL's files. The second line
uses a script provided with the distribution to generate the initial privilegesor grant
tables , which consist of the mysql database with MySQL's superuser,root. This is the
same for MariaDB. The third line changes the ownership of the MySQL directories and
programs to the filesystem user, mysql . The last line changes the group owner of the same
directory and files to the user, mysql .
With the programs installed and their ownerships set properly, you can start MySQL. This
can be done in several ways. To make sure that the daemon is restarted in the event that it
crashes, enter the following from the command line:
/usr/local/mysql/bin/mysqld_safe &
The mysqld_safe daemon,started by this command, will in turn start the MySQL
server daemon, mysqld . If the mysqld daemon crashes, mysqld_safe will restart it. The am-
persand at the end of the line instructs the shell to run the command in the background.
This way you can exit the server and it will continue to run without you staying connec-
ted.
To have MySQL or MariaDB start at boot time, copy the mysql.server file located in the
support-files subdirectory of /usr/local/mysql to the /etc/init.d directory. To do this, enter
the following from the command line:
cp support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
chkconfig --add mysql
The first line follows a convention of placing the start up file for the server in the server's
initial daemons directory with the name, mysql . The second line makes the file executable.
The third sets the run level of the service for startup and shutdown .
Now that MySQL or MariaDB is installed and running, you need to make some post-in-
stallation adjustments, asexplained in Post-Installation .
Source Distributions
Although a binary distribution ofMySQL and MariaDB is recommended, sometimes you
may want to use a source distribution, either because binaries are not available for your
server's operating system, or because you have some special requirements that require
customizing the installation. The steps for installing the source files of MySQL or Mari-
Search WWH ::




Custom Search