1. 程式人生 > >WARNING: The host 'WeiLei' could not be looked up with resolveip.

WARNING: The host 'WeiLei' could not be looked up with resolveip.

[[email protected] data]# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
WARNING: The host 'WeiLei' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
181120 4:37:03 [ERROR] COLLATION 'latin1_swedish_ci' is not valid for CHARACTER SET 'utf8'
181120 4:37:03 [ERROR] Aborting

181120 4:37:03 [Note] /usr/local/mysql//bin/mysqld: Shutdown complete


Installation of system tables failed! Examine the logs in
/usr/local/mysql/data/ for more information.
解決方案:
造成這種錯誤原因是在配置引數時utf8-general_ci寫錯了,應該是utf8_general_ci,
如果不想重新安裝資料庫那就在my.cnf檔案中[mysqld]下面增加一行:
character_set_server=utf8