s2jh mysql mysql 5 7 運維命令

2021-10-18 17:16:15 字數 2393 閱讀 6661

mysql安裝

1)解除安裝舊版本

a) 停掉mysql

#pkill -9 mysqld

b) 檢視rpm包

# rpm -qa|grep -i mysql

c) 刪除

#yum -y remove mysql-community-common-5.6.43-2.el7.x86_64

d) 確認清空

#rpm -qa|grep -i mysql

2)安裝新版本

# wget

#rpm -ivh mysql57-community-release-el7-8.noarch.rpm

b) yum安裝

#yum -y install mysql-server

c) 啟動mysql

#systemctl start mysqld

#systemctl enable mysqld

d) 初始化

#mysql -uroot -p進入

mysql > alter user 'root'@'localhost' identified by 『root』;

mysql > flush privileges;

mysql>exit; 退出後即可用設定的密碼進行登陸

忘記root密碼

cat /etc/mysql/debian.cnf

通過debian 的user和password 進入mysql

mysql > use mysql;

mysql > update user set authentication_string=password("root") where user='root';

建立使用者

create user 'username'@'host' identified by 'password';

mysql > create user 'yangchen'@'localhost' identified by 'yangchen';

授權grant privileges on databasename.tablename to 'username'@'host';

mysql > grant all on *.* to 'yangchen'@'localhost';

授權遠端連線

grant all privileges on *.* to 'root'@'%' identified by 'youpassword' with grant option;

允許root使用者在乙個特定的ip進行遠端登入,並具有所有庫任何操作許可權,具體操作如下: 在本機先使用root使用者登入mysql: mysql -u root -p"youpassword" 進行授權操作: grant all privileges on *.* to root@"172.16.16.152" identified by "youpassword" with grant option; 過載授權表: flush privileges; 退出mysql資料庫: exit

允許root使用者在乙個特定的ip進行遠端登入,並具有所有庫特定操作許可權,具體操作如下: 在本機先使用root使用者登入mysql: mysql -u root -p"youpassword" 進行授權操作: grant select,insert,update,delete on *.* to root@"172.16.16.152" identified by "youpassword"; 過載授權表: flush privileges; 退出mysql資料庫: exit

刪除使用者授權,需要使用revoke命令,具體命令格式為: revoke privileges on 資料庫[.表名] from user-name; 具體例項,先在本機登入mysql: mysql -u root -p"youpassword" 進行授權操作: grant select,insert,update,delete on test-db to test-user@"172.16.16.152" identified by "youpassword"; 再進行刪除授權操作: revoke all on test-db from test-user; ****注:該操作只是清除了使用者對於test-db的相關授權許可權,但是這個「test-user」這個使用者還是存在。 最後從使用者表內清除使用者: delete from user where user="test-user"; 過載授權表: flush privileges; 退出mysql資料庫: exit

修改使用者密碼

mysql > use mysql;

mysql > update user set authentication_string=password("yangchen") where user='yangchen';

刪除使用者

drop user 'username'@'host';

重新整理許可權 flush privileges;

計算機S0 S1 S2 S3 S4 S5狀態

standby。即指說系統處於低電源 狀態,在 windows or bios 中可設定螢幕訊號輸出關閉 硬碟停止運轉進入待機狀態 電源燈處於閃爍狀態。此時動一動滑鼠 按鍵盤任一鍵均可叫醒電腦。power standby。和 s1 幾乎是一樣的。即是把 windows 當前存在記憶體中的所有資料儲存...

S5PV210的啟動詳解2

disable the watch dog timer initialize the instruction cache initialize the stack region see memory map on chap 2.5 initialize the heap region.see mem...

STC12C5A60S2筆記5(省電模式)

1.基本特性 stc12c5a60s2系列微控制器可執行三種省電模式以降低功能,stc正常工作電流是2ma 7ma,而掉電模式下 0.1ua,空閒模式下 0.1ma。1 空閒模式 由電源控制暫存器pcon控制,進入空閒 idle 模式後,cpu無時鐘停止工作,但外部中斷 外部低壓檢測 定時器 ad轉...