Basic MySQL installation on Ubuntu Server

1 comment

Cenario

The cenario for the installation is an Ubuntu Server with version 14.04 of the operating system. you can download the ISO image for the OS instalation at Canonical's website.
You should perform this install only with the basic platform, maybe choosing only the SSH server in case you're planning remote shell access to this server.

Installation Process

After installing the OS, login into the server and follow the steps to perform a basic MySQL server installation on Ubuntu server as described on the official documentation
To install MySQL, run the following command:
sudo apt-get install mysql-server
You'll be prompted to suplly a password for user 'root'. When done, you can check if the service is listening:
sudo netstat -tap | grep mysql
If the service failed to start automatically, you can restart it issuing the command:
sudo service mysql restart

Post Install Validation

To check if the database engine is running and access the database features, open up a command line on the server and execute the mysql command line utility using the root credentials you supplied during setup:
shell> mysql --user=user_name --password=your_password db_name
With the status command, you can confirm the server is running, for how long and which version is it:

For the list of all MySQL commands type 'help'. To exit, type 'quit'.

Installation path analysis

After installing the database server, its files were placed on the following paths on the local file system (keep in mind this is Ubuntu/Debian specific):

  • /usr/bin/ - binary files for the server and command line utilities
  • /usr/lib/ - libraries
  • /usr/share/man/ - manual pages
  • /usr/share/mysql/ - helper scripts for installation  and language support
  • /var/lib/mysql/ - data files
  • /usr/lib/mysql/plugin/ - plugins installed
  • /etc/mysql/ - configuration files
The my.cnf file, on the /etc/mysql/ directory, is the essential place to control the database engine configuration options.

1 comment :

  1. To allow remote network connections to the newly installed MySQL, you should edit the /etc/mysql/my.cfg file and replace the loopback on the bind address with the external network one.

    ReplyDelete