[root@localhost ~]# mysqld --defaults-file=/etc/my.cnf --user=mysql &
[1] 2127
[root@localhost ~]# 210418 19:26:30 [Note] Plugin 'FEDERATED' is disabled.
210418 19:26:30 InnoDB: Initializing buffer pool, size = 8.0M
210418 19:26:30 InnoDB: Completed initialization of buffer pool
210418 19:26:30 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
考虑到mysql服务使用mysql用户启动的,首先增加mysql用户, 修改目录权限: cd /var/lib/mysql chown -R mysql.mysql *
再次启动即可: [root@localhost mysql]# mysqld --defaults-file=/etc/my.cnf --user=mysql & [1] 2286 [root@localhost mysql]# 210418 19:31:06 [Note] Plugin 'FEDERATED' is disabled. 210418 19:31:06 InnoDB: Initializing buffer pool, size = 8.0M 210418 19:31:06 InnoDB: Completed initialization of buffer pool 210418 19:31:06 InnoDB: Started; log sequence number 0 341206 210418 19:31:06 [Note] Event Scheduler: Loaded 0 events 210418 19:31:06 [Note] mysqld: ready for connections. Version: '5.1.73' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
至此启动成功
|