返回信息流欢迎大家踊跃讨论啊[ema1]~~~
/var/log/mysqld.log报错是:
2489 2018-05-07T17:03:22.511863Z 0 [Note] ./mysqld (mysqld 5.7.20) starting as process 16376 ...
2490 2018-05-07T17:03:22.517218Z 0 [Note] InnoDB: PUNCH HOLE support available
2491 2018-05-07T17:03:22.517251Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2492 2018-05-07T17:03:22.517256Z 0 [Note] InnoDB: Uses event mutexes
2493 2018-05-07T17:03:22.517260Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
2494 2018-05-07T17:03:22.517263Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2495 2018-05-07T17:03:22.517267Z 0 [Note] InnoDB: Using Linux native AIO
2496 2018-05-07T17:03:22.517524Z 0 [Note] InnoDB: Number of pools: 1
2497 2018-05-07T17:03:22.517651Z 0 [Note] InnoDB: Using CPU crc32 instructions
2498 2018-05-07T17:03:22.519237Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2499 2018-05-07T17:03:22.527814Z 0 [Note] InnoDB: Completed initialization of buffer pool
2500 2018-05-07T17:03:22.529991Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2501 2018-05-07T17:03:22.540044Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2502 2018-05-07T17:03:22.540074Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2503 2018-05-07T17:03:22.540083Z 0 [ERROR] InnoDB: os_file_get_status() failed on '/root/software/mysql/data/ibdata1'. Can't determine file permissions
2504 2018-05-07T17:03:22.540093Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2505 2018-05-07T17:03:23.140781Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2506 2018-05-07T17:03:23.140835Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2507 2018-05-07T17:03:23.140843Z 0 [ERROR] Failed to initialize plugins.
2508 2018-05-07T17:03:23.140857Z 0 [ERROR] Aborting
2509
2510 2018-05-07T17:03:23.140873Z 0 [Note] Binlog end
2511 2018-05-07T17:03:23.141400Z 0 [Note] ./mysqld: Shutdown complete
所做的尝试:
1.之前以为是SELinux的原因,发现服务器这个选项是disabled的,所以与这个没关系
2.
basedir='/root/software/mysql
datadir=''/root/software/mysql/data'
drwxrwxrwx 6 mysql mysql 4096 5月 8 01:03 data
drwxrwxr-x 11 root root 4096 5月 8 00:22 mysql
data里的ibdata1为:
-rwxrwxrwx 1 mysql mysql 79691776 5月 7 20:16 ibdata1
把basedir的所属者改为mysql也报一样的错
3.my.cnf
1 [client]
2 port = 3306
3 socket = /tmp/mysql.sock
4
5 [mysqld]
6 character_set_server=utf8
7 init_connect='SET NAMES utf8'
8 basedir=/root/software/mysql
9 datadir=/root/software/mysql/data
10 socket=/tmp/mysql.sock
11 log-error=/var/log/mysqld.log
12 pid-file=/var/run/mysqld/mysqld.pid
13 user=mysql
14 #secure.bind-address=myipaddress
15 #不区分大小写
16 lower_case_table_names=1
17 #
18 #sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
19 #
20 #max_connections=5000
21 #
22 default-time-zone='+8:00'
23 innodb_data_home_dir=/root/software/mysql/data/
这是一条镜像帖。来源:北邮人论坛 / database / #10837同步于 2018/5/7
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Database机器人发帖
【已解决】Centos在没有Yum的情况下安装mysql启动报错
Aherine
2018/5/7镜像同步21 回复
订阅后,新回复会通过你的通知中心匿名送达。
9 条回复
你这安装方式也是奇葩,把数据目录放在 /root 下面。为什么不用 yum 安装呢 https://github.com/tuna/issues/issues/143
/root 目录的权限是 rwxr-x---,而你的 mysql 默认以 mysql 用户运行,所以根本就没有权限操作 /root 目录下的东西,除非你以 root 用户身份运行 mysql,当然这样做的话会存在很大的安全风险,是非常不推荐的。
恍然大悟 肥肠感谢!![ema4]
【 在 nitroethane (nitroethane) 的大作中提到: 】
: /root 目录的权限是 rwxr-x---,而你的 mysql 默认以 mysql 用户运行,所以根本就没有权限操作 /root 目录下的东西,除非你以 root 用户身份运行 mysql,当然这样做的话会存在很大的安全风险,是非常不推荐的。