Liunx系统安装/卸载Mysql及设置密码
删除mysql
1.sudo apt-get autoremove --purge mysql-server-5.5
2.sudo apt-get remove mysql-common
清理残留数据
dpkg -l |grep ^rc|awk ‘{print $2}’ |sudo xargs dpkg -P
重新安装mysql
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install libmysqlclient-dev
sudo netstat -tap | grep mysql
设置密码:
sudo su 管理员模式登陆mysql 输入:
update mysql.user set authentication_string=PASSWORD(‘password’), plugin=‘mysql_native_password’ where user=‘root’;