content_image/728832.jpg content_image/728833.jpg content_image/728834.jpg
Complete! 

MySQL and the MySQL server should now be installed. A sample configuration file is installed into / etc/my.cnf . To start the MySQL server use systemctl : 

shell> systemctl start mysqld 

The database tables are automatically created for you, if they do not already exist. You should, however, run mysql_secure_installation  to set the root passwords on your server. 

• Debian, Ubuntu, Kubuntu 

<img src='content_image/728832.jpg'>

## Note 

For supported Debian and Ubuntu versions, MySQL can be installed using the MySQL APT Repository instead of the platform’s native software repository. See Section 2.5.2, “Installing MySQL on Linux Using the MySQL APT Repository”  for details. 

On Debian and related distributions, there are two packages for MySQL in their software repositories, mysql-client  and mysql-server , for the client and server components respectively. You should specify an explicit version, for example mysql-client-5.1 , to ensure that you install the version of MySQL that you want. 

To download and install, including any dependencies, use the apt-get  command, specifying the packages that you want to install. 

<img src='content_image/728833.jpg'>

<img src='content_image/728834.jpg'>

## Note 

Before installing, make sure that you update your apt-get  index files to ensure you are downloading the latest available version. 

## Note 

The apt-get  command installs a number of packages, including the MySQL server, in order to provide the typical tools and application environment. This can mean that you install a large number of packages in addition to the main MySQL package. 

During installation, the initial database is created, and you are prompted for the MySQL root password (and confirmation). A configuration file is created in /etc/mysql/my.cnf . An init script is created in / etc/init.d/mysql . 

The server should already be started. You can manually start and stop the server using: 

root-shell> service mysql [start|stop] 

The service is automatically added to the 2, 3 and 4 run levels, with stop scripts in the single, shutdown and restart levels. 

## 2.5.8 Installing MySQL on Linux with Juju 

The Juju deployment framework supports easy installation and configuration of MySQL servers. For instructions, see https://jujucharms.com/mysql/. 

## 2.5.9 Managing MySQL Server with systemd 

