Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. [MySQL] Failed to set datadir

[MySQL] Failed to set datadir

Scheduled Pinned Locked Moved Database
helphtmlmysqlcomsysadmin
11 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C chipp_zanuff

    i wanna ask. i forgot my MySQL root password, so i tried to fix it based from this link: MySQL :: MySQL and Windows :: 4 Resetting the Root Password: Windows Systems[^] but it still doesn't work and there's few messages, but there's 1 error msg, i.e.: Failed to set datadir to 'C:\Program Files\MySQL\MySQL Server 8.0\data\' (OS errno: 2 - No such file or directory) in addition, there's also a warning i.e.: Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test any1 know how to fix this issue..?

    V Offline
    V Offline
    Victor Nijegorodov
    wrote on last edited by
    #2

    And does the directory 'C:\Program Files\MySQL\MySQL Server 8.0\data\' actually exist?

    C 1 Reply Last reply
    0
    • V Victor Nijegorodov

      And does the directory 'C:\Program Files\MySQL\MySQL Server 8.0\data\' actually exist?

      C Offline
      C Offline
      chipp_zanuff
      wrote on last edited by
      #3

      no. but the questions is: 1. why it make such error..? (e.g. tries to access non-exist folder) 2. why it doesn't create the folder by itself..? 3. should the folder created manually..? since it didn't mentioned anything in the article about that folder or even error-handling if it occurred

      V 1 Reply Last reply
      0
      • C chipp_zanuff

        no. but the questions is: 1. why it make such error..? (e.g. tries to access non-exist folder) 2. why it doesn't create the folder by itself..? 3. should the folder created manually..? since it didn't mentioned anything in the article about that folder or even error-handling if it occurred

        V Offline
        V Offline
        Victor Nijegorodov
        wrote on last edited by
        #4

        chipp_zanuff wrote:

        the questions is: 1. why it make such error..? (e.g. tries to access non-exist folder) 2. why it doesn't create the folder by itself..? 3. should the folder created manually..? since it didn't mentioned anything in the article about that folder or even error-handling if it occurred

        1. But why did you set the non-existing folder? 2. Why do you think the folder should be created by itself? Well, if you really need such a feature then ask the MySQL developers! 3. It looks like the folder should be created manually. :cool:

        1 Reply Last reply
        0
        • C chipp_zanuff

          i wanna ask. i forgot my MySQL root password, so i tried to fix it based from this link: MySQL :: MySQL and Windows :: 4 Resetting the Root Password: Windows Systems[^] but it still doesn't work and there's few messages, but there's 1 error msg, i.e.: Failed to set datadir to 'C:\Program Files\MySQL\MySQL Server 8.0\data\' (OS errno: 2 - No such file or directory) in addition, there's also a warning i.e.: Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test any1 know how to fix this issue..?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #5

          You should not be trying to create data files inside C:\Program Files, it is a protected location. Please see Where Should I Store My Data?[^].

          C 1 Reply Last reply
          0
          • L Lost User

            You should not be trying to create data files inside C:\Program Files, it is a protected location. Please see Where Should I Store My Data?[^].

            C Offline
            C Offline
            chipp_zanuff
            wrote on last edited by
            #6

            i wasn't have you read the link that i posted? i run this command: mysqld --init-file=C:\\mysql-init.txt and the error occurred

            L 1 Reply Last reply
            0
            • C chipp_zanuff

              i wasn't have you read the link that i posted? i run this command: mysqld --init-file=C:\\mysql-init.txt and the error occurred

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #7

              chipp_zanuff wrote:

              have you read the link that i posted?

              I have now. And Googling the message leads to Can't create test file lower test start server mysql - Stack Overflow[^].

              C 1 Reply Last reply
              0
              • L Lost User

                chipp_zanuff wrote:

                have you read the link that i posted?

                I have now. And Googling the message leads to Can't create test file lower test start server mysql - Stack Overflow[^].

                C Offline
                C Offline
                chipp_zanuff
                wrote on last edited by
                #8

                i've created that "data" folder, and run init command.. there was no problem... but when testing connection, the problem still the same, i.e. below pic.. error connection[^] know how to fix it?

                L 1 Reply Last reply
                0
                • C chipp_zanuff

                  i've created that "data" folder, and run init command.. there was no problem... but when testing connection, the problem still the same, i.e. below pic.. error connection[^] know how to fix it?

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #9

                  The message is self-explanatory: one or more of the IP address, port, userid or password are not valid. Check all your settings.

                  C 1 Reply Last reply
                  0
                  • L Lost User

                    The message is self-explanatory: one or more of the IP address, port, userid or password are not valid. Check all your settings.

                    C Offline
                    C Offline
                    chipp_zanuff
                    wrote on last edited by
                    #10

                    one or more of the IP address, port, userid or password are not valid. ?? where did you see this message..? it's not in anything in the picture i shared... the error msg is: Failed connect to MySQL bla bla bla...

                    L 1 Reply Last reply
                    0
                    • C chipp_zanuff

                      one or more of the IP address, port, userid or password are not valid. ?? where did you see this message..? it's not in anything in the picture i shared... the error msg is: Failed connect to MySQL bla bla bla...

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #11

                      The message lists all the values it is trying to use to connect. So it is reasonably safe to assume that one or more of them is not correct. That is the only information you have to work with, so you need to investigate further to discover which one it is.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups