本人想在shell免用户名密码登录
在my.cnf里面设置了
[mysqldump]
# Do not buffer the whole result set in memory before writing it to
# file. Required for dumping very large tables
quick
user=zabbix
password=ys_xx0418
max_allowed_packet = 64M
但是执行还是报错误:
[root@xxx mysql]# mysqldump -h10.2xx.13.13 –socket=/usr/local/mysql/mysql.sock -P3317 test t1 > /tmp/t1.sql
mysqldump: Got error: 1045: Access denied for user “root”@”10.2xx.13.13” (using password: NO) when trying to connect
[root@xxx mysql]#
这是为什么呢?
在my.cnf里面设置了
[mysqldump]
# Do not buffer the whole result set in memory before writing it to
# file. Required for dumping very large tables
quick
user=zabbix
password=ys_xx0418
max_allowed_packet = 64M
但是执行还是报错误:
[root@xxx mysql]# mysqldump -h10.2xx.13.13 –socket=/usr/local/mysql/mysql.sock -P3317 test t1 > /tmp/t1.sql
mysqldump: Got error: 1045: Access denied for user “root”@”10.2xx.13.13” (using password: NO) when trying to connect
[root@xxx mysql]#
这是为什么呢?
解决方案
50
你配置的用户是zabbix这个,但是你用的备份是socket=/usr/local/mysql/mysql.sock -P3317,提示是user “root”@”10.2xx.13.13″用户root密码有问题,通过socket可以不用用户名和密码的,所以你配置了也无效
50
从报错来看,确实是没有起作用,原因是你的mysqldump登录的时候还是用的root账号来登录的。