安装命令:
sudo apt-get install mysql-server mysql-client
显示密码:
sudo cat /etc/mysql/debian.cnf
mariadb默认密码为空
sudo mysql -u root -p
有密码输入密码 没密码就回车
use mysql mysql> select host,user,plugin,authentication_string from user; mysql> update user set plugin="mysql_native_password",authentication_string=password('新密码') where user="root"; mysql> FLUSH PRIVILEGES;
退出来 重新用
sudo mysql -u root -p
进去可以用新密码登录了
以上参考 https://blog.csdn.net/sinat_37064286/article/details/82224562
查看mysql版本
sudo mysql -V mysql Ver 15.1 Distrib 10.1.37-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
apt-get autoremove --purge mysql-server-版本号
apt-get autoremove mysql-server
apt-get remove mysql-common
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
发表评论