1

My /var is full (98% full) so I do try to move the mysql data to /data

I followed instructions from : How to change MySQL data directory?

Problem is : I cannot stop mysql

/etc/init.d/mysql stop

gives:

[ ok ] Stopping mysql (via systemctl): mysql.service.

Byt mysql keeps running.

I tried with

/etc/init.d/mysql stop

STill cannot stop it

# ps -A |grep mysql
12683 ?        00:00:00 mysqld_safe
13028 ?        5-19:29:43 mysqld

Any idea ?

tadman
  • 208,517
  • 23
  • 234
  • 262
yarek
  • 11,278
  • 30
  • 120
  • 219

1 Answers1

1

Did you run the init.d script as root? You can't start or stop services unless you run the command as a superuser.

You can also try shutting down the mysql service using this mysql tool:

mysqladmin -uroot -p shutdown 

Read more here: https://dev.mysql.com/doc/refman/8.0/en/mysqladmin.html

If that doesn't work, I'd check the MySQL error log (the location of the error log varies, but it may be in your datadir or else in /var/log somewhere).

Perhaps it's just taking a long time to do a clean shutdown. MySQL clean shutdown requires it write all the dirty pages in the buffer pool to the disk, in the correct place in the tablespace. This can take a long time if you have a large buffer pool and a lot of modified pages. If it takes too long, the init.d script may give up waiting. But the shutdown is still progressing. The error log may tell you what it's doing.

If the shutdown command doesn't help, the last resort is to terminate the processes with prejudice (sudo kill -9 12683 13028). If you use a durable storage engine like InnoDB (and haven't disabled durability), this won't corrupt your data, but it doesn't really save you any time, because it'll have to perform crash recovery the next time you start the service.

Bill Karwin
  • 538,548
  • 86
  • 673
  • 828