Hostname Already Exists
When searching I found a similar issue from a year or so ago with no clear answer.
Here is my problem:
I am trying to add a host to my fog but it keeps saying the host name already exists. When I search my host list, it’s not there. I think I have some kind of corruption or database issue.
Can anyone help me through this step-by-step as I’m not really a Linux or a MySQL person?
@Tom-Elliott Nevermind, I’m an idiot. I think I found it. I got it. I forgot to change your place holders. Please consider this issue resolved.
@Vanlue-IT-Guy Copy pasted what?
select hostID from hosts where hostname=‘HOSTNAMEOFEXISTINGHOST’;
I copy / pasted that and I get Empty set as the result.
Tom, I’m running 14.04.4 LTS Command Line only. I’m sorry, but how do I get to the MySQL part?
Find the hostname in the database directly using mysql command line.
if No mysql password.
mysql -u root fog
If mysql password
mysql -u root -p fog
select hostID from hosts where hostname='HOSTNAMEOFEXISTINGHOST';
Because it doesn’t, most likely, have the mac address associated you won’t see it in the GUI.
Once found you can simply delete the conflicting entry using:
delete from hosts where hostID=HOSTIDRETURNEDFROMSELECTSTATEMENT;