1. The following three commands are sequentially installed beat
a. sudo apt-get install -y mysql-server
b. sudo apt-get install mysql-client
c. sudo apt-get install -y libmysqlclient-dev
2. The above installation process is basically the default installation, including user names and passwords, how to find the default user name and password to log in MySQL it
Configuration file located in / etc / mysql
Use gedit open debain.cnf, view the user name and password
You can see the user name (user) password (password)
3. Based on the second step of the logon user name and password
mysql -udebian-sys-maint -p3ZDl6sCpKesNnw5n (note -u and -p followed behind a user name and password, no spaces)
Figure: Log success
4. Modify the user name and password
Execute the following statement, using the mysql database, set the user name is root, password is 123456, the use of native encryption (after mysql 8.0 this is not the way the encryption), refresh, and then exits
use mysql;
update user
set
authentication_string
=
PASSWORD(
"123456"
) where user
=
'root'
;
update user
set
plugin
=
"mysql_native_password"
;
flush privileges;
quit;