MySQL 5.6初始化数据库时报错FATAL ERROR: Could not fi

发布时间:2021-09-04 11:53 来源:亿速云 阅读:0 作者:chen 栏目: Mysql 欢迎投稿:712375056

本篇内容主要讲解“ 5.6初始化数据时报错FATAL ERROR: Could not find ./bin/my_print_defaults怎么办”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“MySQL 5.6初始化数据库时报错FATAL ERROR: Could not find ./bin/my_print_defaults怎么办”吧!

MySQL 5.6初始化数据库时报错
[root@localhost scripts]# ./mysql_install_db  --defaults-file=/etc/my_5.6_3306.cnf --datadir=/my3306/data/ --user=mysql
FATAL ERROR: Could not find ./bin/my_print_defaults

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

解决方法
使用全路径进行初始化MySQL

[root@localhost mysql_software_56]# /mysql_software_56/scripts/mysql_install_db  --defaults-file=/etc/my_5.6_3306.cnf --datadir=/my3306/data/ --user=mysql
Installing MySQL system tables...2017-07-29 02:01:18 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2017-07-29 02:01:18 0 [Note] ./bin/mysqld (mysqld 5.6.37-log) starting as process 50198 ...

OK

Filling help tables...2017-07-29 02:03:47 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2017-07-29 02:03:47 0 [Note] ./bin/mysqld (mysqld 5.6.37-log) starting as process 50239 ...
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:

  /mysql_software_56/bin/mysqladmin -u root password 'new-password'
  /mysql_software_56/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:

  /mysql_software_56/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 . ; /mysql_software_56/bin/mysqld_safe &

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

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

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

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

New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

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

免责声明:本站发布的内容(图片、视频和文字)以原创、来自本网站内容采集于网络互联网转载等其它媒体和分享为主,内容观点不代表本网站立场,如侵犯了原作者的版权,请告知一经查实,将立刻删除涉嫌侵权内容,联系我们QQ:712375056,同时欢迎投稿传递力量。