MySQL modify data storage path

MySQL modify data storage directory

Simple Method

  1. View the current directory

    Connection to MySQL
    enter a query directory command

     SHOW VARIABLES LIKE '%datadir%';

    Similar results

     Variable_name  Value           
     -------------  ----------------
     datadir        D:\MySQL\Data\ 
  2. Modify directory

    Stop MySQL service

    To: Data contents of the directory "D \ MySQL \ Data" is copied to the new location you want to store

    MySQL installation directory, locate the my.ini. Modify datadir = "Custom directory" to save.

  3. Confirm directory modification

    Start MySQL service
    enters a query directory command, confirmed directory for the new directory.

    SHOW VARIABLES LIKE '%datadir%';

Guess you like

Origin www.cnblogs.com/ruyu/p/11301340.html