zoukankan      html  css  js  c++  java
  • mysql操作命令(linux)

    mysql操作命令(linux)

    mysql 的守护进程是mysqld

    1、启动mysql:

    [root@localhost ~]# service mysqld start 
    启动 MySQL:                                               [确定]

    如果没有安装则:
    mysqld:未被识别的服务

    2、查看服务是否已经添加到linux上

    [root@localhost ~]# chkconfig --list mysqld 
    mysqld          0:关闭  1:关闭  2:关闭  3:关闭  4:关闭  5:启用  6:关闭

    没有安装则:
    在mysqld服务中读取信息时出错,没有那个文件或目录

    3、检查服务是否在运行

    [root@localhost ~]# ps -el | grep mysqld 
    4 S     0  1796     1  0  85   0 -  1513 wait   ?        00:00:00 mysqld_safe 
    4 S    27  1856  1796  0  78   0 - 34055 -      ?        00:00:00 mysqld 
    [root@localhost ~]# 
    如果看到有,就说明服务安装起来了~~

    4、卸载mysql

    a. 查找已安装的myslq 版本: 
    [root@centosDevelop 桌面]# rpm -qa|grep mysql
    mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
    mysql-libs-5.1.73-3.el6_5.x86_64
    mysql-5.1.73-3.el6_5.x86_64
    mysql-server-5.1.73-3.el6_5.x86_64
    mysql-devel-5.1.73-3.el6_5.x86_64

    b. 卸载查找出来的内容:

    [root@centosDevelop 桌面]# yum remove mysql mysql-server mysql-libs mysql-connector-odbc mysql-devel

    ......

    Installed size: 43 M
    确定吗?[y/N]:y
    ......

    完毕!

    c. 删除mysql数据库文件

    [root@centosDevelop 桌面]# rm -rf /var/lib/mysql

    d. 查看是否还有mysql软件

    [root@centosDevelop 桌面]# rpm -qa|grep mysql

    如果存在则继续删除。

    e. rpm方式安装的mysql

    a)查看系统中是否以rpm包安装的mysql:

    [root@localhost opt]# rpm -qa | grep -i mysql
    MySQL-server-5.6.17-1.el6.i686
    MySQL-client-5.6.17-1.el6.i686

    b)卸载mysql

    [root@localhost local]# rpm -e MySQL-server-5.6.17-1.el6.i686
    [root@localhost local]# rpm -e MySQL-client-5.6.17-1.el6.i686

    c)删除mysql服务

    [root@localhost local]# chkconfig --list | grep -i mysql
    [root@localhost local]# chkconfig --del mysql

    d)删除分散mysql文件夹

    [root@localhost local]# whereis mysql 或者 find / -name mysql

    mysql: /usr/lib/mysql /usr/share/mysql

    清空相关mysql的所有目录以及文件
    rm -rf /usr/lib/mysql
    rm -rf /usr/share/mysql

    rm -rf /usr/my.cnf

    通过以上几步,mysql应该已经完全卸载干净了

  • 相关阅读:
    XTOOL X100 PAD2编程2009 Renault Symbol (Dacia) 所有钥匙丢失
    XTOOL X100 PAD3通过OBD给2014 BMW CAS4 Key编程
    Scania VCI3 SDP3 2.44.1下载免费和安装指南
    VVDI2 V6.7.5 Software Download Free & Install (Update)
    三个步骤解决2m2 magic tank 无法校准HON66钥匙的问题
    VVDI Mini钥匙工具令牌,固件和数据库更新
    kubernetes 认证,授权
    maven 随笔,周末重拾maven
    分布式演进的一点理解
    如何理解持续集成、持续交付、持续部署?
  • 原文地址:https://www.cnblogs.com/suyibin/p/5799690.html
Copyright © 2011-2022 走看看