• 记录一些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库的所有权限

  • 相关阅读:
    hello world之vivado程序解决方法
    FPGA的电源选择重要性分析
    RabbitMQ的简单使用
    RabbitMQ的相关概念
    Spring整合Quartz
    DisallowConcurrentExecution注解
    Quartz框架中的监听器
    JobStore使用
    quartz基本介绍
    java自定义注解
  • 原文地址:https://www.cnblogs.com/zengwenhai/p/8806493.html
Copyright © 2020-2023  润新知