skip to Main Content

I don´t get it. Everytime when i´ve deleted all the content of a mysql-directory in var/lib/mysql/mywebsite, my website still runs on any device or browser without any negative effect. If i look in phpMyAdmin, the database is completely empty! If i delete the whole directory (with directory itself), it has an effect (site is gone), but after restoring this directory with an different database, the old version appears on the website again instead of the new restored database!

BUT if i clear my database tables of that same database in phpMyAdmin, it affects my site immediately… why is that, could it be, that there is any kind of DB-caching on my Vserver?

After:

service mysqld restart

everything is normal, means: right content / right database.

Would be nice if somebody could help me with this.

CentOS 6.9 (Final)‬
Plesk Onyx 17.5.3 Update Nr. 4
Wordpress 4.7.4 (without caching enabled / caching plugins)

2

Answers


  1. Try drop database in PhpMyAdmin, Or execute in your console.

    DROP DATABASE database_name; 
    
    Login or Signup to reply.
  2. On Unix, if a process has a file open while another process deletes it, the process can still access the file — it doesn’t really go away until all processes close it. The mysqld process already has the database files open. So deleting the directory doesn’t affect the contents of the database until you restart it, which forces it to reopen all the files.

    Also, mysqld loads indexes into memory when possible, and doesn’t reread them from the file if it doesn’t need to.

    In general, you should avoid manipulating the files used by a database directly while the daemon is running, the results can be very unpredictable. You should preferably use commands in the database client to manage the database contents, but if you need to restore it from a file-level backup, you should shut down the daemon first.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search