对mysql数据库初始化过程中,会有如下报错信息:

1
2
3
4
5
6
7
[root@localhost scripts]# ./mysql_install_db --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安装目录的bin目下查找是否有_print_defaults,在第一列的第七行有发现这个文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@localhost bin]# ls
innochecksum       mysql_client_test           mysql_setpermission
msql2mysql         mysql_client_test_embedded  mysqlshow
myisamchk          mysql_config                mysqlslap
myisam_ftdump      mysql_convert_table_format  mysqltest
myisamlog          mysqld                      mysqltest_embedded
myisampack         mysqld_multi                mysql_tzinfo_to_sql
my_print_defaults  mysqld_safe                 mysql_upgrade
mysql              mysqldump                   mysql_waitpid
mysqlaccess        mysqldumpslow               mysql_zap
mysqlaccess.conf   mysql_find_rows             perror
mysqladmin         mysql_fix_extensions        replace
mysqlbinlog        mysqlhotcopy                resolveip
mysqlbug           mysqlimport                 resolve_stack_dump
mysqlcheck         mysql_secure_installation

看来其实不是没有这个文件,不是这个问题。

认真查看报错信息,可注意到那个路径是相对路径,是以mysql的安装目录为起始。

而初始化则是进去初始化脚本目录里运行脚本,而在这个目录下不会有./bin/my_print_defaults的。

所以回到安装目录以相对路径去执行初始化脚本。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[root@localhost mysql]# ./scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
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:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
Alternatively you can run:
./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 . ; ./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 with the ./bin/mysqlbug script!
[root@localhost mysql]#

OK!初始化成功!

希望能对大家有帮助

FATAL ERROR: Could not find ./bin/my_print_defaults的解决办法的更多相关文章

  1. FATAL ERROR: Could not find ./bin/my_print_defaults 解决方法

    FATAL ERROR: Could not find ./bin/my_print_defaults If you compiled from source, you need to run 'ma ...

  2. 错误Fatal error: Call to undefined function mb_strlen()的解决办法

    其实这个就是没有开启php_mbstring模块.Windows下只需要修改安装目录下的php.ini文件把extension=php_mbstring.dll前面的“#”号注释符去掉保存后重启Apa ...

  3. System Error. Code:1722. RPC服务器不可用解决办法

    原文链接(转载请注明出处):System Error. Code:1722. RPC服务器不可用解决办法 问题 最近在软件设计上机课的时候,使用 starUML 建模工具画UML图的时候总是弹出一条如 ...

  4. MYSQL报Fatal error encountered during command execution.错误的解决方法

    {MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered during command executio ...

  5. linux下解压大于4G文件提示error: Zip file too big错误的解决办法

    error: Zip file too big (greater than 4294959102 bytes)错误解决办法.zip文件夹大于4GB,在centos下无法正常unzip,需要使用第三方工 ...

  6. Visual Studio error C2001:常量中有换行符(解决办法)

    在Visual Studio自动生成的项目中,碰见了一件关于文件编码的问题,集中在类似于以下的语句上: DASLog (DASProtWarn, L"(%s)消息超时,进入慢循环召唤模式.& ...

  7. 安装MySQL,在./configure时出现错误:error: No curses/termcap library found的解决办法

    是./configure出了问题,于是回头查看,果然发现问题: 最后几行出了错.完整错误信息如下: checking for tgetent in -lncurses... no checking f ...

  8. YUM安装东西提示PYCURL ERROR 6 - "Couldn't错误的解决办法

    执行yum install命令时提示PYCURL ERROR 6 - "Couldn't resolve host 错误,原来是dns设置出错,具体错误代码:  Loaded plugins ...

  9. 用phpmailer发送邮件提示SMTP Error: Could not connect to SMTP host解决办法

    之前做项目的时候做了一个用phpmailer发送邮件的功能<CI框架结合PHPmailer发送邮件>,昨天步署上线(刚开始用新浪云,嫌贵,换成阿里了),测试的时候,发送邮件却意外报错了.. ...

随机推荐

  1. How to DEBUG a trigger or procedure

    DEBUGGING STORED PROCEDURES Over the past several weeks, we’ve been working on debugging a stored pr ...

  2. Typecho 新浪登陆插件 Sinauth

    花了点时间弄了一个插件. 代码地址:https://github.com/web3d/plugins/tree/master/Sinauth Typecho的扩展机制还是比较完善的,可以自行增加Act ...

  3. Scalaz(45)- concurrency :Task-函数式多线程编程核心配件

    我们在上一节讨论了scalaz Future,我们说它是一个不完善的类型,最起码没有完整的异常处理机制,只能用在构建类库之类的内部环境.如果scalaz在Future类定义中增加异常处理工具的话,用户 ...

  4. 在selenium2.0中使用selenium1.0的API

    Selenium2.0中使用WeDriver API对页面进行操作,它最大的优点是不需要安装一个selenium server就可以运行,但是对页面进行操作不如selenium1.0的Selenium ...

  5. Velocity – 另外一款加速的 jQuery 动画插件

    Velocity 是一款 jQuery 插件,重新实现了 $.animate() 方法,提供更高的性能(比 CSS 动画还更快),同时包括一些新的功能,以改进动画工作流程.Velocity 除了包括所 ...

  6. Material UI – Material Design CSS 框架

    Material Design 是谷歌推出的全新的设计理念,采用大胆的色彩.流畅的动画播放,以及卡片式的简洁设计.Material Design 风格的设计拥有干净的排版和简单的布局,容易理解,内容才 ...

  7. 【CSS3】CSS3:border-image的详解和实例

    border-image简介 border-image是CSS3中的新特性.目前几乎所有的主流浏览器都已经支持该特性,详情请移步border-image的兼容性. border-image属性及使用说 ...

  8. jQuery立体式数字动态增加(animate方法)

    1.HTML结构 <div class="integral">已有<span class="ii"></span>积分< ...

  9. TI的DSP、ST的ARM、Intel的X86浮点性能对比

    估计没什么价值,单纯地记录下时间,以便以后查看.   TMS320F28335 STM32f030 i3 4170 i3 4170 主频 150MHz 48MHz 3.7GHZ 3.7GHZ IDE ...

  10. VS 2015打开项目闪退,新建项目提示未将对象引用到实例

    因为开发需要,要把开发工具换成visual studio2015,装完之后会有警告“js”安装的问题,打开VS也没有问题, 但是一打开项目就闪退,新建项目也不行,查看应用程序日志,报错提示如下: .N ...