When trying to start MySQL daemon under the VDS you may get this error:
mysq.hosts table cannot be located.
This means that you lost ‘hosts’ table in the ‘mysql’ database, or the whole ‘mysql’ database ( the database that contains all the authentication data, needed to start and connect MySQL ).
To recover from this issue you will need restore the lost ‘mysql’ database by the following actions:
NOTE: The following actions must be performed as root, after that you must login as the VDS owner to start the MySQL engine.
If you have the backup:
Restore the ‘mysql’ sub-directory in the
If you do not have backup:
- Change to ‘~VDS/usr/local/mysql/var/’ directory.
- Backup all the directories, except ‘mysql’ directory:
# tar czvpf backup.tgz dir1 [dir2] [dir3] …
- Move created archive file four levels up :
# mv backup.tgz ../../../../
- Now you can safely reinstall MySQL Value Up application from the user Control Panel.
- After you reinstalled MySQL VA, you should restore the backed up databases:
# cd ~VDS/usr/local/mysql/var/
# mv ../../../../backup.tgz .
# tar xzvpf backup.tgz
# rm –f backup.tgz
- Login as the VDS owner and start MySQL engine:
$ /usr/local/mysql/bin/mysql.rc start
7. Check if you can connect to MySQL :