1. Open the terminal
2. Install the mysql service: sudo apt-get install mysql-server
3. Install the mysql client: sudo apt-get install mysql-client
4、sudo apt-get install libmysqlclient-dev
5. Check if the installation is successful: sudo netstat -tap | grep mysql
See if it appears:
tcp 0 0 localhost:mysql *:* LISTEN 5947/mysqld
6. Log in to mysql: mysql -u root -p