mysql學習筆記 51 Mysql 學習筆記

2021-10-18 22:15:28 字數 819 閱讀 5050

一. 首先進入mysql      mysql -u root -p新增使用者許可權設定

grant all privileges on *.*  to jerry@localhost identified by 'aa1234567';  ## 只允許本機訪問

grant all privileges on *.* to  [email protected] identified by 'aa1234567' ##只允計遠端訪問

2.查詢使用者新增情況

mysql user,host from mysql.user;

3.使用者許可權查詢

show grants for jerry@localhost;

4. 刪除mysql 使用者

方式一:

drop  user "jerry"@"localhost"  ##表示刪除jerry 本機使用者

drop  user "jerry"@"10.80.80.114" ##表示刪除遠端登入使用者

方式二:

revoke all privileges on *.* from jerry@localhost; ##刪除jerry 本地使用者許可權

use mysql       ##使用mysql

delete from user where user='jerry';      ##刪除jerry 使用者

flush privileges; ## 重新整理資料庫

二. 更改mysql 密碼

[root@localhost ~]# mysqladmin -u root password 新密碼

enter password:   舊密碼

mysql學習筆記 51 mysql學習筆記

初學mysql時整理,隨時更新 資料操作 增 insert into 表名 字段列表 values 值列表 值列表 如果要插入的值列表包含所有字段並且順序一致,則可以省略字段列表。可同時插入多條資料記錄!replace 與 insert 完全一樣,可互換。insert into 表名 set 欄位名...

MySQL自學筆記系列 零基礎上手MySQL

本文是對我學習資料庫和mysql時學習筆記的整理。都是一些基本的語法規則,作為自己的mysql使用查詢手冊。1.資料庫簡介 介紹了什麼是資料庫,主流資料庫有哪些,mysql的特點。2.mysql 初識 了解資料庫的儲存結構,介紹建庫,建表的基本操作。3.mysql 資料型別 介紹mysql支援的資料...

Python 學習筆記 5 1 高階函式

高階函式英文叫higher order function。什麼是高階函式?我們以實際 為例子,一步一步深入概念。以python內建的求絕對值的函式abs 為例,呼叫該函式用以下 abs 10 10但是,如果只寫abs呢?abs infunction abs 可見,abs 10 是函式呼叫,而abs是...