root account but is similar in that it has all privileges on the MySQL server. Let’s look at three situations You’ve installed the server using RPM or Debian packages You’ve installed a system-wide server using a tarball or by compiling source code You’ve installed a local server to run under your own account using a tarball or by compiling source code.
As
we explained earlier, the XAMPP package is tightly integrated and is not designed for easy modification, so we won’t explore how to customize an XAMPP installation.
Configuring a server installed using RPM or Debian packagesThe package installation process generally places the
MySQL program files in the /usr/bin directory, the datafiles in the
/var/lib/mysql directory, and the server logs in the
/var/log/mysqld directory or the
/var/log/mysqld.log file.
The installation typically configures the files and directories
securely and also creates the /etc/init.d/mysql or
/etc/init.d/mysqld (MySQL daemon) startup script for easy control of the server.
Check what this script is called on your system using the ls command
ls /etc/init.d/mysql*/etc/init.d/mysql
In the preceding example,
the file is called mysql. Use the appropriate name (
mysql or mysqld
) where you see
mysqlin the commands below.
To
start the server, run the following command
/etc/init.d/mysql startSet a password for the database root account
mysqladmin --user=root password the_new_mysql_root_passwordYou can stop the server by typing the command
/etc/init.d/mysql stopThe package-based installation process generally starts the MySQL server, and configures it to be started automatically each time the system is started. In “Configuring
MySQL for automatic
start later in this chapter, we explain how to check and configure automatic startup.
Share with your friends: