When the Mac uses Navicat to connect to MySQL, Oracle and other databases, it may appear
Navicat 连接 Oracle 报 ORA-21561: OID generation failed
Error, let's take a look at how to fill this pit.
1. Confirm hostname
Enter the following command in the terminal: hostname
shows the following:
![](https://upload-images.jianshu.io/upload_images/2645110-cc29c67af59f29f2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2. View hosts
Enter the following command in the terminal: vi /etc/hosts
![](https://upload-images.jianshu.io/upload_images/2645110-0321a3b36ec3c031.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3. Troubleshoot problems
It can be determined that the hostname is local, which is inconsistent with the corresponding name of 127.0.0.1 in the hosts being localhost, and the modification can be consistent.
Enter sudo scutil --set HostName localhost in the terminal
The modification takes effect immediately, and there is no problem in connecting to the database in Navicat again at this time.