mysqldump Got error 1290
在用mysqldump備份時候遇到1290的錯誤
[mysql@localhost ~]$ mysqldump -uroot -pxxzx7817600 --tab=/mysqldata/tmp query_rewrite mysqldump: [Warning] Using a password on the command line interface can be insecure. mysqldump: Got error: 1290: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement when executing 'SELECT INTO OUTFILE'
從提示看到是因為mysql服務啟用了--secure-file-priv,所以才無法執行。這個選項或系統變數用被來限制透過load data和select ... into outfile語句和load_file()函式所執行匯入和匯出操作的資料量。
secure_file_priv有以下設定:
.如果為空,變數不生效。沒有安全設定。
.如果設定為一個目錄名,伺服器對匯入和匯出操作只對這個目錄中的檔案生效,但目錄必須存在,伺服器不會建立目錄。
.如果設定NULL,伺服器禁止匯入和匯出操作。
檢視資料庫當前設定:
mysql> show global variables like '%secur%'; +--------------------------+-------+ | Variable_name | Value | +--------------------------+-------+ | require_secure_transport | OFF | | secure_auth | ON | | secure_file_priv | NULL | +--------------------------+-------+ 3 rows in set (0.01 sec)
看到secure_file_priv當前設定為NULL,說明限制匯入和匯出操作。
檢視配置檔案my.cnf發現沒有設定secure_file_priv引數,那麼這個引數預設應該是為NULL。
[mysql@localhost mysql]$ cat my.cnf [mysqld] basedir=/mysqlsoft/mysql datadir=/mysqldata/mysql bind-address=* user=mysql port=3306 log-error=/mysqldata/mysql/mysql.err pid-file=/mysqldata/mysql/mysqld.pid socket = /mysqlsoft/mysql/mysql.sock character-set-server=utf8mb4 default-storage-engine=INNODB explicit_defaults_for_timestamp = true innodb_flush_method=O_DIRECT binlog_format = mixed log-bin=/mysqldata/mysql/binlog max_binlog_size = 100m binlog_cache_size = 4m server-id=1
修改配置檔案my.cnf參加secure_file_priv=
[mysql@localhost mysql]$ vi my.cnf ..... secure-file-priv=
重啟mysql資料庫
[root@localhost ~]# service mysqld restart Shutting down MySQL.... SUCCESS! Starting MySQL.. SUCCESS!
再次檢查secure_file_priv引數設定
mysql> show global variables like '%secur%'; +--------------------------+-------+ | Variable_name | Value | +--------------------------+-------+ | require_secure_transport | OFF | | secure_auth | ON | | secure_file_priv | | +--------------------------+-------+ 3 rows in set (0.00 sec)
再執行匯出操作成功
[mysql@localhost ~]$ mysqldump -uroot -pxxzx7817600 --tab=/mysqldata/tmp mysql mysqldump: [Warning] Using a password on the command line interface can be insecure.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-2707293/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mysqldump Got error: 1045MySqlGoError
- Last_IO_Error: Got fatal error 1236ASTErrorGo
- mysqldump: Error: Binlogging on server not activeMySqlErrorServer
- ERROR 1290 (HY000): The MySQL server is running withErrorMySqlServer
- ERROR 1290 (HY000) 解決辦法Error
- mysqldump匯出報錯"mysqldump: Error 2013 ... during query when dumping tableMySqlError
- ERROR 1290:The MySQL server is running with the --secure-file-priv optionErrorMySqlServer
- 解決ERROR 1030 (HY000): Got error 168 from storage engine apparmorErrorGoAPP
- MySQL 報錯 ERROR 1290 (HY000): running with the --secure-file-privMySqlError
- ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables optErrorMySqlServer
- 【MySQL】ERROR 1290 (HY000): --secure-file-priv--匯出報錯MySqlError
- mysqldump: Error 2013: Lost connection to MySQL server during query when dumpingMySqlErrorServer
- mysqldump error1066 錯誤的解決辦法MySqlError
- MySQL案例09:Last_IO_Error: Got fatal error 1236 from master when reading data from binary logMySqlASTErrorGo
- Linux:ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannLinuxErrorMySqlServer
- MySQ匯出資料包錯Error 2020: Got packet bigger than 'max_allowed_packet'ErrorGo
- MySQL主從複製報錯:Got fatal error 1236 from master when reading data fromMySqlGoErrorAST
- DreamJudge-1290-日期差值
- 【mysqldump】mysqldump及備份恢復示例MySql
- mysqldump原理分析MySql
- mysqldump小談MySql
- Using mysqldump for backupsMySql
- Got socket error trying to find package flutter_lints at https://pub.dev Flutter pub.dev錯誤的解決方案GoErrorPackageFlutterHTTPdev
- mysqldump 深入淺出MySql
- mysqldump 使用規範MySql
- mysqldump的最佳實踐MySql
- mysqldump引數說明MySql
- MYSQL-mysqldump學習MySql
- Mysqldump的備份流程MySql
- MySQLDump的備份方法MySql
- mysqldump備份技巧分享MySql
- SharePlex reader missed marker wait for xx but got xxAIGo
- 動態連結的PLT與GOTGo
- MySQL:MTS和mysqldump死鎖MySql
- windows mysqldump備份指令碼WindowsMySql指令碼
- 使用 Got包的一些體會Go
- mysqldump的內部實現原理MySql
- mysql 大表mysqldump遷移方案MySql