在Debian12上安装mysql 8.0
从deb安装默认是区分大小写的
一、安装过程
-
设置为不区分大小写, 请参考 https://www.cnblogs.com/binli33/p/18531992
二、 常用命令
mysql -uroot -p
apt-get --purge autoremove mysql-server
systemctl start mysql
systemctl status mysql
systemctl stop mysql
三、 其他
注意:root账号在debian系统中无法直接开启远程连接,安全起见我们新建一个mysql用户;
CREATE USER 'test'@'%' IDENTIFIED BY 'xxxxx';
GRANT ALL PRIVILEGES ON . TO 'test'@'%' WITH GRANT OPTION;
软件连接异常
报错:Authentication plugin ‘caching_sha2_password’ cannot be loaded
> 1. 修改账户密码加密规则并更新用户密码
ALTER USER 'test'@'%' IDENTIFIED BY 'xxxxxx' PASSWORD EXPIRE NEVER;
> 2. 更新一下用户的密码
ALTER USER 'test'@'%' IDENTIFIED WITH mysql_native_password BY 'xxxxxx';
> 3. 刷新权限并重置密码
FLUSH PRIVILEGES;