当前位置: 首页 > news >正文

FATAL ERROR: Could not find ./bin/my_print_defaults的解决办法

对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!初始化成功!

希望能对大家有帮助

 

转载于:https://www.cnblogs.com/wajika/p/6242224.html

相关文章:

  • 第二热门语言:从入门到精通,Python数据科学简洁教程
  • SQLite入门与分析(四)---Page Cache之事务处理(3)
  • Linux 文件基本属性
  • linux常用命令以及命令帮助的使用
  • linux 安装fileinfo扩展
  • Linux 2.6.19.x 内核编译配置选项简介
  • Hibernate实体关系映射(OneToMany、ManyToOne双边)——完整实例
  • ASL4000驱动
  • 40 个轻量级 JavaScript 库 (下)
  • Exchange 2013 配置邮件流
  • 序列化对象存储与反序列化--比较方便查看对象
  • java Nio 异步操作(四)channel
  • Share Point 开发系列之二:SharePoint 网站元素介绍
  • html 调用qq客服
  • 已测,Centos安装git2.2.1
  • 【Redis学习笔记】2018-06-28 redis命令源码学习1
  • 【跃迁之路】【444天】程序员高效学习方法论探索系列(实验阶段201-2018.04.25)...
  • co.js - 让异步代码同步化
  • echarts的各种常用效果展示
  • ESLint简单操作
  • Invalidate和postInvalidate的区别
  • java2019面试题北京
  • JavaScript 事件——“事件类型”中“HTML5事件”的注意要点
  • Java基本数据类型之Number
  • k个最大的数及变种小结
  • Lucene解析 - 基本概念
  • python学习笔记 - ThreadLocal
  • spring学习第二天
  • 更好理解的面向对象的Javascript 1 —— 动态类型和多态
  • 解决iview多表头动态更改列元素发生的错误
  • 两列自适应布局方案整理
  • 免费小说阅读小程序
  • 如何设计一个比特币钱包服务
  • 如何抓住下一波零售风口?看RPA玩转零售自动化
  • 腾讯视频格式如何转换成mp4 将下载的qlv文件转换成mp4的方法
  • 提升用户体验的利器——使用Vue-Occupy实现占位效果
  • ionic入门之数据绑定显示-1
  • LIGO、Virgo第三轮探测告捷,同时探测到一对黑洞合并产生的引力波事件 ...
  • (2)nginx 安装、启停
  • (3)选择元素——(17)练习(Exercises)
  • (Redis使用系列) SpringBoot中Redis的RedisConfig 二
  • (SpringBoot)第二章:Spring创建和使用
  • (第二周)效能测试
  • (顶刊)一个基于分类代理模型的超多目标优化算法
  • (附源码)ssm经济信息门户网站 毕业设计 141634
  • (使用vite搭建vue3项目(vite + vue3 + vue router + pinia + element plus))
  • (数位dp) 算法竞赛入门到进阶 书本题集
  • (算法设计与分析)第一章算法概述-习题
  • (原創) 物件導向與老子思想 (OO)
  • (转)socket Aio demo
  • (转)程序员技术练级攻略
  • (转)总结使用Unity 3D优化游戏运行性能的经验
  • .Net 垃圾回收机制原理(二)
  • .net 受管制代码
  • .net 托管代码与非托管代码