apt update wget https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb
https://dev.mysql.com/downloads/repo/apt/
<font size=1> dpkg -i mysql-apt-config_0.8.29-1_all.deb </font>
如果提示lsb-release依赖 apt install lsb-release
同上 apt install gnupg dpkg -i mysql-apt-config_0.8.29-1_all.deb
apt update apt install mysql-server
<font size=1> 查看MySQL编码,默认为utf8mb4。</font>
mysql> show variables like '%character%';
修改MySQL密码 set password for 'root'@'localhost'=password('root'); 远程连接 创建新用户 注意:root账号在debian系统中无法直接开启远程连接,所以需要新建mysql用户;
CREATE USER 'your_username'@'%' IDENTIFIED BY 'your_password'; 将your_username替换为你想要创建的用户名,将your_password替换为你想要设置的密码。
新用户授权 GRANT ALL PRIVILEGES ON . TO 'your_username'@'%' WITH GRANT OPTION; 刷新MySQL权限 FLUSH PRIVILEGES;