LoginSignup
0
1

More than 3 years have passed since last update.

mysqldump の警告対策

Last updated at Posted at 2021-04-22

coreserver などで使われている次バージョンでエラーが出た時の対策です。

mysql> select version();
+------------+
| version()  |
+------------+
| 5.7.33-log |
+------------+

エラーの状況

$ mysqldump -uscott -ptiger123 city > city.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces

対策 1 (警告をひとつ消します)

$ mysqldump --no-tablespaces -uscott -ptiger123 city > city.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.

対策 2 (もうひとつの警告を消します)
次のファイルを作成

dbase.conf
#
#   dbase.conf
#
[client]
user = scott
password = tiger123
#

警告が出ません

$ mysqldump --defaults-extra-file=./dbase.conf --no-tablespaces city > city.sql
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1