Note
The following instructions assume that no versions of MySQL
(whether distributed by Oracle or other parties) have already
been installed on your system; if that is not the case, follow
the instructions given in
Replacing a Native Distribution of MySQL Using the MySQL APT Repository or
Replacing a MySQL Server Installed by a Direct deb Package Download instead.
-
Adding the MySQL APT Repository
First, add the MySQL APT repository to your system's software repository list. Follow these steps:
- Go to the download page for the MySQL APT repository at http://dev.mysql.com/downloads/repo/apt/.
- Select and download the release package for your Linux distribution.
-
Install the downloaded release package with the
following command, replacing
version-specific-package-name
with the name of the downloaded package (preceded by its path, if you are not running the command inside the folder where the package is):
shell> sudo dpkg -i /PATH/version-specific-package-name.deb
For example, for version
w.x.y-z
of the package, the
command is:
shell> sudo dpkg -i mysql-apt-config_w.x.y-z_all.deb
You can always change your choices for the versions later; see Selecting a Major Release Version for instructions.
shell> sudo apt-get update
Instead of using the release package, you can also add and configure the MySQL APT repository manually; see Appendix A: Adding and Configuring the MySQL APT Repository Manually for details.
Note
Once the MySQL APT repository is enabled on your system, you
will no longer be able to install any MySQL packages from
your platform's native software repositories until the MySQL
APT repository is disabled.
Installing MySQL with APT
Install MySQL by the following command:shell> sudo apt-get install mysql-server
During the installation, there are two requests by the dialogue boxes:
-
Supply a password for the root user for your MySQL
installation.
ImportantMake sure you remember the root password you set. Users who want to set a password later can leave the password field blank in the dialogue box and just press Ok; in that case, root access to the server will be authenticated by Socket Peer-Credential Pluggable Authentication for connections using a Unix socket file. You can set the root password later using the program mysql_secure_installation.
- Indicate if you want to install the test database with “Yes” or “No.” Installation of the test database is not recommended for production environments.
Starting and Stopping the MySQL Server
The MySQL server is started automatically after installation. You can check the status of the MySQL server with the following command:shell> sudo service mysql status
Stop the MySQL server with the following command:
shell> sudo service mysql stop
To restart the MySQL server, use the following command:
shell> sudo service mysql start
Note
A few third-party native repository packages that have
dependencies on the native MySQL packages may not work with the
MySQL APT repository packages and should not be used together
with them; these include akonadi-backend-mysql,
handlersocket-mysql-5.5, and zoneminder.
No comments:
Post a Comment