6

I am trying to set up mySQL for the second time on my laptop. I had previously installed and run mysql-installer-web-community-8.0.22.0 without any problem couple of months ago. Recently I uninstalled that version and installed the newer one mysql-installer-web-community-8.0.23.0. I get no errors during installation, but when I want to work with MySQL workbench I get the error as "no connection established." I have already fixed services such that mySQL is running. but I get the error message for not being able to connect to the localhost. I have tried the following commands, but I get the following error messages.

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql -u root -p
Enter password: ****
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqld --console
2021-03-23T12:38:52.603298Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.23) starting as process 8452
2021-03-23T12:38:52.661405Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-03-23T12:38:52.666405Z 1 [ERROR] [MY-012271] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2021-03-23T12:38:52.668889Z 1 [ERROR] [MY-012278] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2021-03-23T12:38:52.670851Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2021-03-23T12:38:52.674130Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2021-03-23T12:38:52.675978Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-23T12:38:52.677643Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.23)  MySQL Community Server - GPL.

Searching Stackoverflow and other forums I find more suggestions for how to solve similar issues for Linux rather than Windows.

Farzaneh
  • 168
  • 3
  • 10
  • https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html – Daniel W. Mar 23 '21 at 13:24
  • Does this answer your question? [How to change the mysql root password](https://stackoverflow.com/questions/8789522/how-to-change-the-mysql-root-password) – Daniel W. Mar 23 '21 at 13:25
  • 1
    Seems like two different problems maybe. Have you given mysqld permission to write to the database file like the error suggests? `The innodb_system data file 'ibdata1' must be writable` – Daniel W. Mar 23 '21 at 13:26
  • I followed the instructions in https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html, and it didn't help. I'll put it in the problem description. – Farzaneh Mar 23 '21 at 13:51
  • https://stackoverflow.com/questions/8789522/how-to-change-the-mysql-root-password is helpful for Linux users. – Farzaneh Mar 23 '21 at 13:53
  • It contain's answers for windows too. – Daniel W. Mar 23 '21 at 13:59
  • Have you given write permission to the data file? MySQL cannot write anything if you don't give it write permission on file level. It can't store your password either without write permission. – Daniel W. Mar 23 '21 at 13:59
  • Thanks for your comments! It works now! I'll just add to your answer below the link you put here. :) – Farzaneh Mar 23 '21 at 14:21

2 Answers2

3

Seems like this also happens when you try to run mysqld --console while the MySQL service is already running (and that instance might be locking the "ibdata1" file).

enter image description here

Zolbayar
  • 896
  • 12
  • 29
1
[InnoDB] The innodb_system data file 'ibdata1' must be writable

The error is clear:

Without being able to write data, MySQL cannot do anything for you. It can't store your data or passwords if you don't allow MySQL to write to the filesystem, so fix that first and then try the guides on changing the password again.

Try the instruction in the link below: https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html

Farzaneh
  • 168
  • 3
  • 10
Daniel W.
  • 31,164
  • 13
  • 93
  • 151
  • 1
    The error is also just wrong, sometimes. I have every possible permission enabled on `ibdata1` and I still get this error. – Andrew Koster Feb 16 '22 at 19:23