zoukankan      html  css  js  c++  java
  • Ubuntu 重装 mysql

    我另篇blog有提到修改完my.cnf文件后mysql server重新启动失败,就是说mysql server启动不起来了,于是我就想到重装再试试,没想到就好了。

    重装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 

     上述代码的第一步(即:sudo apt-get autoremove --purge mysql-server-5.0)可执行可不执行,因为我不知道自己之前安装的版本= =所以就没有执行第一步。

    清理残留的数据:

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

    这样就将mysql彻底卸载了,下面就该安装新的mysql:

    ~$ sudo apt-get install mysql-server

     安装过程会弹出提示框,输入root用户的密码。

    安装完成后,MySQL服务器会自动启动,下面为检查MySQL服务器程序:

    ~$ ps -aux|grep mysql
    mysql     3205  2.0  0.5 549896 44092 ?        Ssl  20:10   0:00 /usr/sbin/mysqld
    conan     3360  0.0  0.0  11064   928 pts/0    S+   20:10   0:00 grep --color=auto mysql
    
    ~$ netstat -nlt|grep 3306
    tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
    
    ~$ sudo /etc/init.d/mysql status
    Rather than invoking init scripts through /etc/init.d, use the service(8)
    utility, e.g. service mysql status
    Since the script you are attempting to invoke has been converted to an
    Upstart job, you may also use the status(8) utility, e.g. status mysql
    mysql start/running, process 3205
    
    ~$ sudo service mysql status
    mysql start/running, process 3205

    转载自本人ITeye链接:http://xiaozhuang0706.iteye.com/blog/2258381

    don't look back boy~
  • 相关阅读:
    CSS实现DIV水平自适应居中
    jQuery实现鼠标拖动改变Div高度
    Word2013创建目录
    raw,cow,qcow,qcow2镜像的比较
    Chrome浏览器官方下载地址
    OLE/COM 对象查看器 & OLE常用术语
    VmWare为Fedora虚拟机扩展磁盘
    Linux常用命令
    项目经理与客户沟通的宜与忌
    转 FileStream Read File
  • 原文地址:https://www.cnblogs.com/BHfeimao/p/6496547.html
Copyright © 2011-2022 走看看