1. 程式人生 > >mysql 安裝錯誤:FATAL ERROR: Neither host '* nor 'localhost' could be looked up with /usr/bin/resolveip

mysql 安裝錯誤:FATAL ERROR: Neither host '* nor 'localhost' could be looked up with /usr/bin/resolveip

1、採用命令 mysql_install_db –user=mysql 安裝時報錯
$ sudo ./scripts/mysql_install_db –user=mysql

FATAL ERROR: Neither host ‘liminpc’ nor ‘localhost’ could be looked up with
/usr/bin/resolveip
Please configure the ‘hostname’ command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the –force option

2.命令增加 –datadir=/usr/local/mysql/data,啟動成功

sudo ./scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql –datadir=/usr/local/mysql/data –skip-name-resolve

**@****pc:/usr/local/mysql$ sudo ./scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql –datadir=/usr/local/mysql/data –skip-name-resolve
Installing MySQL system tables…2015-08-24 10:55:19 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2015-08-24 10:55:19 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
2015-08-24 10:55:19 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.25-enterprise-commercial-advanced) starting as process 3319 …
2015-08-24 10:55:19 3319 [Warning] Using pre 5.5 semantics to load error messages from /usr/share/mysql/.
2015-08-24 10:55:19 3319 [Warning] If this is not intended, refer to the documentation for valid usage of –lc-messages-dir and –language parameters.
OK

Filling help tables…2015-08-24 10:55:26 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2015-08-24 10:55:26 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
2015-08-24 10:55:26 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.25-enterprise-commercial-advanced) starting as process 3356 …
2015-08-24 10:55:26 3356 [Warning] Using pre 5.5 semantics to load error messages from /usr/share/mysql/.
2015-08-24 10:55:26 3356 [Warning] If this is not intended, refer to the documentation for valid usage of –lc-messages-dir and –language parameters.
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/local/mysql/bin/mysqladmin -u root password ‘new-password’
/usr/local/mysql/bin/mysqladmin -u root -h 192.168.1.159 password ‘new-password’

Alternatively you can run:

/usr/local/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd . ; /usr/local/mysql/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

The latest information about MySQL is available on the web at

Support MySQL by buying support/licenses at http://shop.mysql.com

WARNING: Found existing config file /usr/local/mysql/my.cnf on the system.
Because this file might be in use, it was not replaced,
but was used in bootstrap (unless you used –defaults-file)
and when you later start the server.
The new default config file was created as /usr/local/mysql/my-new.cnf,
please compare it with your file and take the changes you need.

WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
–defaults-file argument to mysqld_safe when starting the server

WARNING: Default config file /etc/mysql/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
–defaults-file argument to mysqld_safe when starting the server

sudo ./mysqld_safe –user=mysql –skip-grant-tables –skip-networking &

socket = /var/run/mysqld/mysql.sock

最後推薦一下,個人自營api資料平臺,有各種各樣資料,歡迎訪問。www.yunshuda.cn 雲數達