zoukankan      html  css  js  c++  java
  • 回顾:Linux环境 Mysql新建用户和数据库并授权

     回顾:Linux环境 Mysql新建用户和数据库并授权

    一、新建用户

    //登录Mysql

    @>mysql -u root -p
    @>密码


    //创建用户

    mysql> insert into mysql.user(Host,User,Password)
    values('localhost','xdev',password('xdev123'));
    //刷新系统权限表
    mysql>flush privileges;
    //这样就创建了一个名为:xdev密码为:xdev123 的用户。

    二、登录测试

    mysql>exit;
    @>mysql -u cplusplus -p
    @>输入密码
    mysql>登录成功


    三、用户授权

    //登录MYSQL
    @>mysql -u root -p
    @>密码
    //首先为用户创建一个数据库(tz_ebank)
    mysql>create database tz_ebank;
    
    //给来自10.163.225.87的用户joe分配可对数据库vtdc的employee表进行select,insert,update,delete,create,drop等操作的权限,并设定口令为123。
    
    mysql>grant select,insert,update,delete,create,drop on vtdc.employee to joe@'%' identified by '123';
    
    //给来自10.163.225.87的用户joe分配可对数据库vtdc所有表进行所有操作的权限,并设定口令为123。
    mysql>grant all privileges on vtdc.* to joe@10.163.225.87 identified by '123';
    
    //给来自10.163.225.87的用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。
    mysql>grant all privileges on *.* to joe@10.163.225.87 identified by '123';
    
    //给本机用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。
    mysql>grant all privileges on *.* to joe@localhost identified by123′;

    四,linux下开启、关闭、重启mysql服务命令


    一、 启动
    1、使用 service 启动:service mysql start
    2、使用 mysqld 脚本启动:/etc/inint.d/mysql start
    3、使用 safe_mysqld 启动:safe_mysql&

    二、停止
    1、使用 service 启动:service mysql stop
    2、使用 mysqld 脚本启动:/etc/inint.d/mysql stop
    3、mysqladmin shutdown

    三、重启
    1、使用 service 启动:service mysql restart
    2、使用 mysqld 脚本启动:/etc/inint.d/mysql restart

    四、查看mysql状态

    >>mysql

  • 相关阅读:
    Deep Reinforcement Learning with Population-Coded Spiking Neural Network for Continuous Control
    A Survey of Robotics Control Based on Learning-Inspired Spiking Neural Networks
    The neurobiology of deep reinforcement learning
    【Matplotlib】线设置,坐标显示范围
    MarkdownPad2 下一些设置
    MarkdownPad2 在 Windows10 下 预览无法显示
    【Scipy】初步认识
    【Matplotlib】详解图像各个部分
    【Matplotlib】概要总览第一讲
    【Python】重载模块
  • 原文地址:https://www.cnblogs.com/chinway/p/9366084.html
Copyright © 2011-2022 走看看