1. update the source list. in the terminal window, enter sudoapt-getupdate -- press enter -- enter the password of the root user -- press Enter. If you do not run this command and install mysql directly, several software packages cannot be downloaded. you can run apt-getupdate ------. 1. update the source list to open the terminal window ", enter "sudo apt-getupdate" --> Press enter --> "Enter the root user password" --> press Enter. If you do not run this command and install mysql directly, an error message "you can run apt-getupdate ------" appears, causing installation failure.
2. install mysql
Open the terminal window ", enter "sudo apt-get install mysql-servermysql-client" --> Press enter --> enter "y" --> Press enter --> in the "package settings dialog box", enter "root" in mysql" user password --> Press enter --> re-enter password --> press enter, installation is complete.
3. how to determine whether mysql is successfully installed
Open the terminal window and enter "sudo service mysqlrestart" --> Press enter --> if mysql is started successfully and is running, mysql is installed successfully.
4. log on to mysql
Open the terminal window and enter mysql-u root-p. --> Press enter --> enter the password of the "root" user in mysql --> Press enter --> log on successfully. (Set the mysql password to root in this system)