Home  >  Article  >  Database  >  Mysql and apt-get uninstall and install under ubuntu

Mysql and apt-get uninstall and install under ubuntu

黄舟
黄舟Original
2017-09-02 13:30:091656browse

本文给大家分享ubuntu下apt-get安装和彻底卸载mysql的方法,文中提到了安装mysq命令查看mysql是否运行的命令写法,具体内容详情大家通过本文学习吧

1、安装mysql:


udo apt-get install mysql-server
udo apt-get install mysql-client
udo apt-get install php5-mysql(用于连接php和mysql)

查看mysql是否运行


aux | grep mysql

启动命令


/etc/init.d/mysql start

2.删除mysql

按顺序执行以下命令


udo apt-get autoremove --purge mysql-server-5.0
udo apt-get remove mysql-server
udo apt-get autoremove mysql-server
udo apt-get remove mysql-commo

清理残留数据


dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

总结

The above is the detailed content of Mysql and apt-get uninstall and install under ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn