1. After the installation is complete, type in the terminal:
$ mysql --version
- The display version number is normal. If the command not found is displayed, enter the following in the terminal. "/usr/local/mysql/bin/mysql" is the default installation path of mysql:
$ cd /usr/local/bin/
$ sudo ln -fs /usr/local/mysql/bin/mysql mysql
2. Restart the mysql service (the system is easy to set);
3. Terminal input:
$ mysql -u root -p
4. Enter the initial random password, such as:
A temporary password is generated for root@localhost: Wt/oJMbZs5rg
The login is successful as shown below:
5. The terminal executes the following three sentences (the trailing semicolon cannot be lost):
SET PASSWORD = PASSWORD('your new password');
ALTER USER ‘root‘@‘localhost‘ PASSWORD EXPIRE NEVER;
flush privileges;
After the modification is successful, you can log in with the new password~~~