当前位置: 代码迷 >> MySQL >> ubtntu剔除mysql与安装mysql
  详细解决方案

ubtntu剔除mysql与安装mysql

热度:269   发布时间:2016-05-05 16:27:48.0
ubtntu删除mysql与安装mysql

删除mysql

sudo apt-get autoremove --purge mysql-server-5.0

sudo apt-get remove mysql-server

sudo apt-get autoremove mysql-server

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 php5-mysql

一旦安装完成,mysql服务器就会自动启动

执行命令sudo netstat -tap | grep mysql出现tcp 0 0 localhost.localdomain:mysql *:* LISTEN -

如果服务器不能正常运行,输入命令sudo /etc/init.d/mysql restart

进入mysql $mysql -u root -p(password)

配置mysql管理员密码

sudo mysqladmin -u root password newpassword

  相关解决方案