1. Update list apt get
sudo apt-get update
2. Install MySQL server and client
sudo apt-get install mysql-server mysql-client
3. When installing the server, if there is no default password, there is no password. Enter the following command to enter mysql
mysql -u root -p
4. Modify the root password. Note that the password field does not exist and needs to be modified to authentication_ String to modify
use mysql;
update mysql.user set authentication_string=password('root') where user='root' and Host ='localhost';
update user set plugin="mysql_native_password";
flush privileges;
quit;
5. Set the encoding, modify the/etc/MySQL/my.cnf file, and add the following contents:
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
6. Enter Mysql to view the status (whether the code is utf8)
status or \s
7. Start and close MySQL service
open:service mysql start
close:service mysql stop
restart:service mysql restart
Read More:
- Mysql5.7.18.1 Error 1054 (42S22): Unknown Column’password’ In’field List’ When Changing User Password
- ERROR 1054(42S22) Unknown column ‘password’ in ‘field list’ (Fixed)
- [Solved] ERROR 1054 (42S22): Unknown column ‘password‘ in ‘field list‘
- [Solved] pymysql.err.internalError: (1054, “Unknown column ‘LGD_xiaohong’ in ‘field list’”)
- [Solved] Daily further: database error: unknown column ‘model’ in ‘field list‘
- Docker mysql8 modify password
- [Solved] There is a problem with mysql8.0 without password in Navicat connection
- MySQL Change password failure prompt: ERROR 1064(42000):You have an error in your SQL syntax: check the corresponds to your M
- How To Change ASM SYS PASSWORD
- MYSQL Error 1045 (28000): access denied for user ‘root’ @’localhost ‘(using password: Yes)
- [Solved] there are special symbols in the initial password for installing MySQL in Hadoop, and an error is reported
- MYSQL Enter password:ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost:3306‘
- [Solved] Access denied for user ‘root‘@‘localhost‘ (using password: YES)
- MYSQL Use cmd to change root password error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual tha
- [Solved] Navicat Connect MySQL error: Authentication plugin ‘caching_sha2_password‘ cannot be loaded
- mysql ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executin
- [Solved] Sequelize DatabaseError: ER_WRONG_FIELD_WITH_GROUP: Expression #2 of SELECT list is not in GROUP
- linux mysql ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- [Solved] Caused by: java.sql.SQLException: Access denied for user ‘root‘@‘hadoop102‘ (using password: YES)
- ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number