原因
纳尼,Mac电脑用Navicat连接Oracle报错了,平时用来连接MySQL甚是好用,今天准备连接Oracle数据库看下数据,竟然连接不上。emmm.......
点击连接测试失败后弹出异常:
ORA-24454:client host name is not set???
解决办法
打开终端,输入hostname
$ hostname
amaocldeMacBook-Pro.local
然后看下/etc/hosts文件内容
$ cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section
发现hostname不一致
执行命令:sudo scutil --set HostName localhost
重新测试连接成功