The versions installed through apt are the latest versions. After installation in this way, the startup and self startup have been configured, and the environment variables on the command line do not need to be configured manually.
- 1. Unpacking
$ sudo dpkg -i mysql-apt-config_0.8.14-1_all.deb
- 2. Update system installation source
After execution, execute
$ sudo apt update
- 3. Install MySQL service
$ sudo apt install mysql-server
MySQL 8.0 adopts a new encryption method. It must be noted that it is this encryption method that makes the set root password unable to log in to MySQL, because there may be a problem with the terminal and does not support this new encryption method. Fortunately, the interface allows us to choose to use the encryption method of the old version 5. X, so we resolutely choose to use the encryption method of 5. X.
- 4. Modify the character set of MySQL server
To modify the character set, first find the installation location of MySQL. You can use the following command: $ whereis mysql
- 5. Restart MySQL service
$ service mysql restart
- 6. Login
$ mysql -uroot -p
- 7. Modify client character set
In order to display Chinese characters normally, the client character encoding needs to be modified. After successful login, enter charset utf8 in the console window.
Enter status on the console to display the following information
However, using Navicat remote connection discovery cannot connect
$ show databases; $ use mysql $ select host from user wehre user='root'; $ update user set host = '%' where user = 'root'; $ flush privileges;
This work adoptsCC agreement, reprint must indicate the author and the link to this article