Step 1 — Installing MySQL
There are two ways to install MySQL. You can either use one of the versions included in the APT package repository by default (which are 5.5 and 5.6), or you can install the latest version (currently 5.7) by manually adding MySQL's repository first.
If you want to install a specific version of MySQL, follow the appropriate section below. To help you decide which version is best for you, you can read MySQL's introduction to MySQL 5.5, then what's new in MySQL 5.6 and what's new in MySQL 5.7.
If you're not sure, you can just use the mysql-server APT package, which just installs the latest version for your Linux distribution. At the time of writing, that's 5.5, but you can always update to another version later.
To install MySQL this way, update the package index on your server and install the package with apt-get.
sudo apt-get update
sudo apt-get install mysql-client d mysql-server
Step 2
Login To Mysql With Username And Password
Mysql -u root -p password
Note: In MySQL 5.6, you might get an error that says FATAL ERROR: Could not find my-default.cnf. If you do, copy the /usr/share/my.cnf configuration file into the location that mysql_install_db expects, then rerun it.
Ещё видео!