Home > Database > Mysql Tutorial > Ubuntu下彻底卸载mysql_MySQL

Ubuntu下彻底卸载mysql_MySQL

WBOY
Release: 2016-06-01 13:44:43
Original
981 people have browsed it

Ubuntumysql卸载

bitsCN.com

1、删除 mysql

1  sudo apt - get autoremove  -- purge mysql - server - 5.0
2  sudo apt - get remove mysql - server
3  sudo apt - get autoremove mysql - server
4  sudo apt - get remove mysql - common (非常重要)
上面的其实有一些是多余的,建议还是按照顺序执行一遍

清理残留数据

dpkg  - l  | grep  ^ rc | awk  ' {print $2} '   | sudo xargs dpkg  - P
  2、安装 mysql
1  sudo apt - get install mysql - server
2  sudo apt - get install mysql - client
3  sudo apt - get install php5 - mysql (安装php5-mysql 是将php和mysql连接起来 )
 

一旦安装完成,MySQL 服务器应该自动启动。您可以在终端提示符后运行以下命令来检查 MySQL 服务器是否正在运行:
1  sudo netstat  - tap  |  grep mysql
 

当您运行该命令时,您可以看到类似下面的行:

tcp 0 0 localhost.localdomain:mysql *:* LISTEN -
如果服务器不能正常运行,您可以通过下列命令启动它:


1  sudo  / etc / init.d / mysql restart
 

3、进入mysql

$mysql -uroot -p 管理员密码
配置 MySQL 的管理员密码:

1  sudo mysqladmin  - u root password newpassword

摘自:mac.zhao的博客

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template