自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

AutoMySQLBackup遇到的幾個(gè)問題

運(yùn)維 數(shù)據(jù)庫運(yùn)維
使用AutoMySQLBackup備份MariDB時(shí),手工執(zhí)行shell腳本中的腳本 /mysql_backup/scripts/automysqlbackup /mysql_backup/scripts/conf/myserver.conf 沒有問題。

 [[428182]]

本文轉(zhuǎn)載自微信公眾號「DBA閑思雜想錄」,作者瀟湘隱者。轉(zhuǎn)載本文請聯(lián)系DBA閑思雜想錄公眾號。

1:使用AutoMySQLBackup時(shí)遇到錯(cuò)誤:Error: Dependency programs are missing. Perhaps they are not in $PATH. Exiting

使用AutoMySQLBackup備份MariDB時(shí),手工執(zhí)行shell腳本中的腳本 /mysql_backup/scripts/automysqlbackup /mysql_backup/scripts/conf/myserver.conf 沒有問題。但是在作業(yè)(crontab)里面執(zhí)行腳本時(shí)遇到下面錯(cuò)誤:

  1. Note: Parsed config file /mysql_backup/scripts/conf/myserver.conf. 
  2. Note: /etc/automysqlbackup/automysqlbackup.conf was not found - no global config file. 
  3. Error: Dependency programs are missing. Perhaps they are not in $PATH. Exiting. 

出現(xiàn)這個(gè)問題,一般是由于環(huán)境變量引起的。需要修改配置文件myserver.conf中的參數(shù)PATH,使用命令ps -ef | grep -i mysqld 找到mysqldump所在的路徑后,配置myserver.conf的參數(shù)PATH即可解決問題。

案例如下所示:

  1. Default values are stored in the script itself. Declarations in 
  2. # /etc/automysqlbackup/automysqlbackup.conf will overwrite them. The 
  3. # declarations in here will supersede all other. 
  4.  
  5. # Edit $PATH if mysql and mysqldump are not located in /usr/local/bin:/usr/bin:/bin:/usr/local/mysql/bin 
  6. #PATH=${PATH}:FULL_PATH_TO_YOUR_DIR_CONTAINING_MYSQL:FULL_PATH_TO_YOUR_DIR_CONTAINING_MYSQLDUMP 
  7. PATH=${PATH}:/app/mariadb/bin 

2:mysqldump: Couldn't execute 'SHOW FIELDS FROM xxx': View xxxx.xxxx' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them (1356)

AutoMySQLBackup其實(shí)是封裝了mysqldump的一個(gè)shell腳本,在一個(gè)案例中,具體報(bào)錯(cuò)如下所示:

 

  1. ==================================================================================================================================== 
  2. ............................................................................................................................. 
  3. Errors reported during AutoMySQLBackup execution.. Backup failed 
  4. Error log below.. 
  5. mysqldump: Couldn't execute 'SHOW FIELDS FROM `xxx`': View xxxx.xxxx' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them (1356) 
  6.  
  7. ............................................................................................................................. 
  8. ==================================================================================================================================== 

遇到這個(gè)問題,首先檢查賬號權(quán)限,AutoMySQLBackup使用的賬號為dbbackup,具體權(quán)限如下所示,一般而言,這樣的權(quán)限是沒有問題的。

  1. GRANT SELECT, RELOAD, LOCK TABLES, REPLICATION CLIENT, SHOW VIEW, EVENT, TRIGGER ON *.* TO 'dbbackup'@'127.0.0.1'
  2. GRANT EXECUTE ON sys.* TO 'dbbackup'@'127.0.0.1'
  3. FLUSH PRIVILEGES

使用dbbackup登錄MySQL,切換到對應(yīng)用戶數(shù)據(jù)庫,執(zhí)行下面命名時(shí),還真遇到了權(quán)限問題。

  1. mysql> SHOW FIELDS FROM `xxx`; 
  2. ERROR 1356 (HY000): View 'xxx.xxx' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them 
  3. mysql> 

然后使用root賬號查看視圖定義

  1. mysql> show create view xxx\G; 

最后一一排查下來,發(fā)現(xiàn)是視圖xxx中引用了一個(gè)Function,但是用戶dbbckup沒有這個(gè)函數(shù)的執(zhí)行權(quán)限,所以報(bào)這個(gè)錯(cuò)誤。授予用戶下面權(quán)限后,問題解決

  1. GRANT EXECUTE ON xxx.* TO 'dbbackup'@'127.0.0.1'
  2. FLUSH PRIVILEGES

關(guān)于這個(gè)問題,還有可能是因?yàn)橐晥D引用了無效的表,列或函數(shù),而不一定是視圖的定義者/調(diào)用器缺乏調(diào)用它們的權(quán)限。

 

責(zé)任編輯:武曉燕 來源: DBA閑思雜想錄
相關(guān)推薦

2022-05-24 16:09:38

前端腳本

2013-05-06 15:42:49

2009-09-07 14:39:14

2010-06-09 16:57:14

路由選擇協(xié)議

2011-07-01 09:31:49

.net

2011-05-18 11:31:56

數(shù)據(jù)安全數(shù)據(jù)備份

2021-03-03 21:24:57

數(shù)據(jù)倉庫工具

2017-11-20 10:45:26

數(shù)據(jù)中心遷移IDC

2017-11-28 10:34:47

數(shù)據(jù)中心遷移IDC

2011-07-04 16:40:39

QT 串口 QML

2013-08-29 09:47:32

開源hypervisor

2013-11-12 09:16:00

SDN思科Insieme

2009-11-06 14:07:58

Oracle用戶表空間

2022-01-12 08:53:04

數(shù)字化疫情企業(yè)發(fā)展

2021-01-19 08:25:20

Java反射進(jìn)階

2011-09-14 15:23:00

Android 2.2

2015-09-17 10:51:35

修改hostnameLinux

2009-08-05 18:47:55

ASP.NET服務(wù)器

2019-01-29 07:44:14

2019-01-07 14:36:36

Go系統(tǒng)開源庫
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號