System information
Installing MySQL for CentOS
To install MySQL on CentOS, run the following command. You will be prompted to
install several dependencies. Press Enter to accept, and the MySQL server and de-
pendency packages will be installed:
$ sudo yum install mysql-server
Install 5 Package(s)
Upgrade 0 Package(s)
Total download size: 27 M
Is this ok [y/N]: y
Then start the MySQL database by running:
$ sudo service mysqld start
Now head to “Configuring MySQL” on page 345 to perform the initial configuration.
Installing MySQL for Ubuntu
To install MySQL on Ubuntu, run the following command. You will be prompted to
install several dependencies. Press Enter
to accept, and the MySQL server and its de-
pendency packages will be installed:
$ sudo apt-get install mysql-server
Need to get 24.0MB of archives.
After this operation, 60.6MB of additional disk space will be used.
Do you want to continue [Y/n]? y
During the installation, you will be placed into a configuration wizard to help you
through the initial configuration of the database. You will be prompted to enter a new
password for the root user. Type in a strong password and press Enter. You will then
be asked to confirm the password. Type your strong password again, followed by
Enter. You will then be returned to the console, where the installation will complete.
The MySQL service will now be running.
Now head to “Configuring MySQL” on page 345 to perform the initial configuration.
Configuring PostgreSQL
Next, create a user called asterisk, which you will use to connect to and manage the
database. You can switch to the postgres user by using the following command:
$ sudo su - postgres
At the time of this writing, PostgreSQL version 8.1.x is utilized on
CentOS, and 8.4.x on Ubuntu.
Installing and Configuring PostgreSQL and MySQL | 343