MySQL基礎 操作與配置)

2021-09-29 01:39:00 字數 955 閱讀 6025

mysql使用者

使用者資訊都存放在mysql資料庫的user表中,新使用者建立後不能登入,需要設定許可權。

#建立乙個新使用者

create user 使用者名稱 identified by '密碼'

;#刪除使用者

drop user 使用者名稱;

#重新命名使用者

rename 原使用者名稱 to 新使用者名稱;

修改密碼
#修改當前使用者密碼

set password = password(

'新密碼'

);#修改指定使用者密碼

set password for 使用者名稱 = password(

'新密碼'

);

檢查使用者能否連線。

檢查使用者是否具有所執行動作的許可權。

分為五個層級:

全域性層級

資料庫層級

表層級列層級

子程式層級

授權命令

#授予乙個使用者許可權

grant all privileges on 層級 to '使用者名稱'@'主機名' idenitified by '密碼';

#例如:grant all privileges on *.* to 'test'@'%' idenitified by 'test';

#撤銷使用者全部許可權

revoke all privileges from 使用者名稱;

最為廣泛使用的備份恢復工具:mysqldump

#備份乙個指定的資料庫

mysqldump -u root -p 資料庫名稱 > 備份檔案.sql

#備份恢復

mysql -u root -p 資料庫名稱 < 備份檔案.sql

編碼影響:

資料內容的大小

資料庫與客戶端的通訊

mysql 與操作 MySql基礎概念與操作

include include include mysql.h include using std string using std vector pragma comment lib,libmysql void dealsql const char pmysqlc,mysql pmysql if ...

mysql基礎操作語句 Mysql基礎操作語句

比如乙個學生表student有三個欄位id,name,資料型別分別為int varchar varchar 增加資料 語法 insert into 表名 values val1,val2.例 insert into student values 1516,張三 男 部分字段插入 insert int...

mysql基礎配置檔案 MySQL 配置基礎

mysql作為一種常見的資料庫管理系統 dbms 其自身的各種配置項極大的影響了其效能。所以有必要進行了解和學習。配置學習資源途徑 mysql配置 配置檔案位置 一般來說,mysql服務端配置檔案的預設位置是 etc my.cnf 或者 etc mysql my.cnf 也可以通過mysqld ve...