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~
  • 相关阅读:
    Jmeter后置处理器之Json提取器
    Jmeter体系结构-事务控制器
    一款免费的自动化测试工具:AirtestProject
    jsonpath-rw处理json对象
    MySQL常用SQL
    Git使用
    charles的mock功能
    Django项目之blog表设计(二)
    Django小项目之blog(一)
    selenium无界面浏览器,访问百度搜索为例
  • 原文地址:https://www.cnblogs.com/BHfeimao/p/6496547.html
Copyright © 2011-2022 走看看