zoukankan      html  css  js  c++  java
  • 记录一些mysql数据库常用操作命令和问题汇总

    A.启动数据库

    1.使用service方式:

    [root@localhost /]# service mysqld stop (5.0版本是mysqld)
    [root@szxdb etc]# service mysql stop (5.5.7版本是mysql)

    2.使用 mysqld 脚本启动:

    /etc/inint.d/mysqld start

    B.停止数据库

    1.使用service方式

    [root@localhost /]# service mysqld stop (5.0版本是mysqld)
    [root@szxdb etc]# service mysql stop (5.5.7版本是mysql)

    2.使用mysqld脚本停止:

    /etc/inint.d/mysqld stop

    C.重启数据库

    1.使用service方式

    [root@localhost /]# service mysqld restart (5.0版本是mysqld)
    [root@szxdb etc]# service mysql restart (5.5.7版本是mysql)

    2.使用mysqld脚本重启

    /etc/init.d/mysqld restart

    2.启动数据失败:提示unrecognized service

    可以使用脚本命令尝试一下:/etc/init.d/mysql start

    ➜  redisLog service msyql start
        msyql: unrecognized service

      ➜  bin /etc/init.d/mysql start
         Starting MySQL
         *

     

    3.创建用户命令

    create user test@'%' identified by 'test';

    增加一个test用户,密码为test,%表示不限制登录IP,可以加个IP表示只能在192.168.1.1上登录

    4.给用户赋予某个数据库的全部权限:

    grant all privileges on testdb.* to test@'%' identified by 'test';

    给test用户赋值testdb库的所有权限

  • 相关阅读:
    基于ARP的网络扫描工具netdiscover
    渗透测试集成环境Faraday
    NBNS扫描工具nbtscan-unixwiz
    分享Kali Linux 2017年第18周镜像文件
    Hat's Fibonacci
    N!
    A + B Problem II(大数加法)
    产生冠军(拓扑排序)
    确定比赛名次
    Legal or Not(模板题)
  • 原文地址:https://www.cnblogs.com/zengwenhai/p/8806493.html
Copyright © 2011-2022 走看看