deepin MySQL 安装以及编码格式的修改utf-8

deepin MySQL 安装以及编码格式的修改utf-8

1、sudo apt-get install mysql-server mysql-client


2、sudo mysql -u root -p


3、update mysql.user set plugin="mysql_native_password" where user="root";


4、update mysql.user set authentication_string=password('1234') where user='root' and Host='localhost';


5、sudo service mysql restart


6、mysql -u root -p


7、(输入 mysql 密码)


8、set character_set_database=utf8;


9、set character_set_server=utf8;


10、set global character_set_database=utf8;


11、set global character_set_server=utf8;

原文地址:https://www.cnblogs.com/GetcharZp/p/10080711.html