Installing MySQL on Ubuntu is very simple and can be done with just a few commands.
sudo apt-get install mysql-server
apt-get isntall mysql-client
-
3.
sudo apt-get install libmysqlclient-dev
During the installation process, you will be prompted to set a password or something. Be careful not to forget the settings. After the installation is complete, you can use the following command to check whether the installation is successful:
sudo netstat -tap | grep mysql
After checking through the above command, if you see that the mysql socket is in the listen state, the installation is successful.
To log in to the mysql database, use the following command:
mysql -u root -p
-u means to select the user name to log in, -p means the user password to log in, after entering the above command, you will be prompted to enter the password, at this time, you can log in to mysql by entering the password.