zoukankan      html  css  js  c++  java
  • MySQL基础

    为数据库创建特定的用户和密码

    mysql>grant all privileges on <database>.* to '<username>'@'localhost' identified by '<password>';
    mysql>grant all privileges on <database>.* to '<username>'@'localhost' identified by '<password>';
    

    举例,为icebug用户创建专属的数据库icebug_db,且密码为icebug_passwd

    mysql>create database icebug_db;
    mysql>grant all privileges on icebug_db.* to 'icebug'@'localhost' identified by 'icebug_passwd';     # 目的是本地可访问
    mysql>grant all privileges on icebug_db.* to 'icebug'@'%' identified by 'icebug_passwd';             # 目的是远程主机可以访问
    

    创建好了之后就可以直接通过用户icebug和密码icebug_passwd登陆数据库系统了,注意通过icebug账号和icebug_passwd登陆之后只能看到数据自己的数据库,并不能看到别人的数据库,这也是为什么要为特定数据库创建特定账号和密码了,千万注意不要人手一个root账号和密码.....

    登陆

    icebug@localhost:~$ mysql -uicebug -picebug_passwd
    

    这样就可以登陆icebug的数据库了~

    tips:

    最好不要这样直接把密码放到命令行里一块敲,不然很容易在bash history中留下密码痕迹,出于安全考虑还是通过mysql -uicebug -p之后再敲入密码为好。

  • 相关阅读:
    python模块
    Django基础
    Python __str__(self)和__unicode__(self)
    Redis基本操作
    测试面试宝典
    h5页面的测试方式
    selenium IDE的使用流程
    如何安装chrome扩展程序--selenium IDE
    Selenium 中 强制等待、显示等待、隐式等待的区别
    Selenium+Python 自动化 之八种元素定位方法
  • 原文地址:https://www.cnblogs.com/dspace/p/6111621.html
Copyright © 2011-2022 走看看