zoukankan      html  css  js  c++  java
  • mysql数据库创建数据库创建用户授权

    Liunx下登录数据库

    >mysql -u 用户名 -p

    创建myblog用户,本地登录,口令是myblog

    create user 'myblog'@'localhost' identified by 'myblog';

    创建数据库 myblogdb 并设置字符集为utf-8

    create database myblogdb default character set utf8 COLLATE utf8_general_ci;

    授予myblog 用户myblogdb数据库的所有权限
    grant all privileges on myblog.* to 'myblog'@'localhost' identified by 'myblog';

    授权 myblog 用户远程登录权限
    grant all privileges on myblog.* to 'myblog'@'%' identified by 'myblog' with grant option;

    刷新权限表
    flush privileges;

    查看用户和登录限定的host

    select user,host from msyql.user;

    重启mysql服务
    #service mysql restart

  • 相关阅读:
    [日料探店] 食一料理
    工地英语
    C++20协程解糖
    C++20协程解糖
    C++20协程解糖
    单表操作
    数据库查询语句罗列
    数据库简易介绍
    mysql的常用操作
    css基础
  • 原文地址:https://www.cnblogs.com/lingdurebing/p/ldrb-mysql1.html
Copyright © 2011-2022 走看看