mysql更改datadir无法启动_MySQL更改datadir报错无法启动

MySQL更改datadir报错无法启动

在ubuntu上将mysql的存储目录更改到其他磁盘分区上

更改步骤:

1.、/etc/init.d/mysql stop

2、vim /etc/mysql/my.cnf

datadir                = /data/mysql       //之前为/var/lib/mysql

3、mv /var/lib/mysql  /data/                   //data在其他分区上

4 、/etc/init.d/mysql start

但是重启后就显示各种报错信息:

150611 13:41:39 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

150611 13:42:31 mysqld_safe Starting mysqld daemon with databases from /data/mysql

150611 13:42:31 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.

150611 13:42:31 [Note] /usr/sbin/mysqld (mysqld 5.5.43-0ubuntu0.14.04.1) starting as process 26942 ...

150611 13:42:31 [Warning] Can't create test file /data/mysql/iZ23urd20hoZ.lower-test

150611 13:42:31 [Warning] Can't create test file /data/mysql/iZ23urd20hoZ.lower-test

150611 13:42:31 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.

150611 13:42:31 [Note] Plugin 'FEDERATED' is disabled.

/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)

150611 13:42:31 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

150611 13:42:31 InnoDB: The InnoDB memory heap is disabled

150611 13:42:31 InnoDB: Mutexes and rw_locks use GCC atomic builtins

150611 13:42:31 InnoDB: Compressed tables use zlib 1.2.8

150611 13:42:31 InnoDB: Using Linux native AIO

150611 13:42:31 InnoDB: Initializing buffer pool, size = 128.0M

150611 13:42:31 InnoDB: Completed initialization of buffer pool

150611 13:42:31  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.

150611 13:42:31 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

请问各位大神,是哪里有问题吗。第3行的那个“nstead of”应该影响不大吧。

我在新开的虚拟机上按照上面的步骤,就成功了,没有这么多报错。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值