mysqld: Can't change dir to data. Server doesn't start

后端 未结 14 1275
失恋的感觉
失恋的感觉 2020-12-07 13:16

I installed a MySQL server with installer and it started. After reboot I tried to start it again and get the error:

D:\\Program Files\\MySQL\\MySQL Server 5.         


        
相关标签:
14条回答
  • 2020-12-07 13:44

    Check your real my.ini file location and set --defaults-file="location" with this command

    mysql --defaults-file="C:\MYSQL\my.ini" -u root -p
    

    This solution is permanently for your cmd Screen.

    0 讨论(0)
  • 2020-12-07 13:48

    What I did (Windows 10) for a new installation:

    1. Start cmd in admin mode (run as administrator by hitting windows key, typing cmd, right clicking on it and selecting "Run as Administrator"

    2. Change into "MySQL Server X.Y" directory (for me the full path is C:\Program Files\MySQL\MySQL Server 5.7")

    3. using notepad create a my.ini with a mysqld section that points at your data directory

      [mysqld]
      datadir="X:\Your Directory Path and Name"
      
    4. created the directory identified in my.ini above.

    5. change into bin Directory under server directory and execute: mysqld --initialize

    6. Once complete, started the service and it came up fine.

    0 讨论(0)
提交回复
热议问题