hive使用過程中對mysql授權問題

2021-07-24 13:24:20 字數 2109 閱讀 7455

授權:

1.mysql> grant all privileges on *.* to root@'%' identified by '123456';

2.mysql>grant all privileges on *.* to 'root'@'%'with grant option ;

3.mysql>flush privileges;

刪除授權:

mysql>delete from mysql.user where user="root" and host="%";

檢視使用者表:

select host,user,password,grant_priv,super_priv from mysql.user;

如果命令輸錯了,在user表中產生了一條授權,需要刪除掉,不然會對再次授權有影響,可能會授權失敗。

遇到的問題:

一。mysql -uroot -p123

出現:error 1045 (28000): access denied for user 'root'@'localhost' (using password: yes)

解決方法:

1.service mysqld stop

2.mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

3.mysql -u root mysql;

4.mysql> insert into mysql.user (host,user,password) values('%','system', password('manager'));

5.mysql> flush privileges ;

二。error 1044 (42000): access denied for user 'root'@'%' to database 'hive'

mysql> select host,user,password,grant_priv,super_priv from mysql.user;

檢視user表,發現root沒有許可權

解決方法:

1.service mysqld stop

2.mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

3.mysql -u root mysql

4.mysql>update mysql.user set grant_priv='y', super_priv='y' where user='root';

5.mysql>flush privileges;

如果是測試環境下,可以解除安裝資料庫重新安裝

完全解除安裝方法:

1.yum remove mysql mysql-server

2.rm -rf /var/lib/mysql

3.rm /etc/my.cnf

使用mysql自帶的工具修改root使用者密碼方法:

$ sudo /usr/bin/mysql_secure_installation

[...]

enter current password for root (enter for none):

ok, successfully used password, moving on...

[...]

set root password? [y/n] y

new password:

re-enter new password:

remove anonymous users? [y/n] y

[...]

disallow root login remotely? [y/n] n

[...]

remove test database and access to it [y/n] y

[...]

reload privilege tables now? [y/n] y

all done!

element ui dialog使用過程中的坑

場景一 我們將dialog寫成乙個可復用的公共元件用於顯示不同內容 如 操作中的修改或新增的彈窗 之後發現dialog的遮罩將彈出層 點選修改或新增後理應由乙個彈窗顯示出來 都蓋住了,而我想要的效果是遮罩只遮住舊的視窗,而當前視窗應該完全顯示 注 是使用easyui的panel和window來包裹的...

python使用過程中問題

1.檢視python支援的 whl格式 在cmd輸入python 或者 python3.6 import pip print pip.pep425tags.get supported 2.在修改python.exe為python36.exe 任何重新命名 後,pip會報錯 fatal error i...

Spring data Jpa使用過程中遇到的坑

一定要注意如果我們在實體類中沒有配置資料表的預設值,那麼在存入和取出的時候應該設定。否則在取出的時候就會出現問題。如何通過一方獲取到多方實體 jsp中 jsp資料夾與上面servlet對映名最好不要一致,這樣會出問題 注意!乙個實體類的表id名字請設定為id,保證不出錯。問題分析 解決方法 其實一般...