mysqld: File '.\binlog.index' not found (OS errno 13 - Permission denied) - mysql

its a duplicate question but i still cannot solve this problem.
I have forgotten my MySQL root user password and i followed this troubleshoot steps https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html
upon running the command
mysqld --init-file=C:\\mysql-init.txt --console
it gives following output
2022-09-26T12:10:19.366600Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.30) starting as process 7280
2022-09-26T12:10:19.368952Z 0 [Warning] [MY-010091][Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test
2022-09-26T12:10:19.369022Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test mysqld: File '.\binlog.index' not found (OS errno 13 - Permission denied)
2022-09-26T12:10:19.371806Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-09-26T12:10:19.372077Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
i cannot even run
mysql
it gives following error
ERROR 1045 (28000): Access denied for user 'ODBC'#'localhost' (using
password: NO)
I am not sure what is wrong here.

i got it working after several more steps other than those mentions in the document.
After FreudianSlip comments to make sure to start mysqld as administrator i got rid of these error but it still didnt work . what actually worked is mentioned in this comment https://stackoverflow.com/a/65214867/19982606

Related

Cannot reinstall MySql "Could not connect to MySql with the given password" on Windows. Forgot root password

I am learning Spring Batch. I followed the instructions to install MySQL Shell 8.0.26 and also the Workbench 8.0 on Windows 11.
However I get
MySQL JS > alter user 'root'#'localhost' IDENTIFIED WITH mysql_native_password by 'password';
SyntaxError: Unexpected identifier
MySQL JS > show schemas;
SyntaxError: Unexpected identifier
MySQL JS > show databases;
So I tried to uninstall and reinstall MySql.
When I run the installer,
I have forgotten the root password. What should I do?
In this similar SO question the person remembered the password.
I did an internet search and tried to follow the steps here
https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html
C:\Program Files\MySQL\MySQL Server 8.0\bin>.\\mysqld --init-file=C:\\Documents\\mysql-init.txt
2021-11-15T00:37:15.052478Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.26) starting as process 5260
2021-11-15T00:37:15.054496Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test
2021-11-15T00:37:15.054535Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test
2021-11-15T00:37:15.054651Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to 'C:\Program Files\MySQL\MySQL Server 8.0\data\' (OS errno: 2 - No such file or directory)
2021-11-15T00:37:15.056382Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-11-15T00:37:15.056496Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.26) MySQL Community Server - GPL.
C:\Program Files\MySQL\MySQL Server 8.0\bin>
I found this article and it says that one must manually delete the following folders. Merely Uninstalling from Windows Control Panel is not enough.
C:\Program Files\MySQL
C:\Program Files (x86)\MySQL
C:\ProgramData\MySQL
https://answers.microsoft.com/en-us/windows/forum/windows_other-windows_programs/how-to-completely-uninstall-mysql/e90e1344-7b90-4319-8b2f-77b271ae66ed
I followed the steps and when I ran the installer again, it asked for a new root password!

The innodb_system data file 'ibdata1' must be writable - access denied for user root#localhost'

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.
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).
[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

msqld: Can't change dir (OS errno 13 - Permission denied)

I installed mysql for Mac 10.14 using the .dmg file at the top here: https://dev.mysql.com/downloads/mysql/, and ran through the installer. My system os is Mac 10.13.6, but there is a note that says this should work.
At /usr/local/ there's both a mysql folder and a mysql-8.0.13-macos10.14-x86_64 folder.
When I run mysqld I get the following error:
mysqld: Can't change dir to '/usr/local/mysql-8.0.13-macos10.14-x86_64/data/' (OS errno 13 - Permission denied)
ts 0 [System] [MY-010116] [Server] /usr/local/mysql-8.0.13-macos10.14-x86_64/bin/mysqld (mysqld 8.0.13) starting as process 9863
ts 0 [Warning] [MY-010091] [Server] Can't create test file /usr/local/mysql-8.0.13-macos10.14-x86_64/data/Monicas-MacBook-Pro.lower-test
ts 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/mysql-8.0.13-macos10.14-x86_64/data/ is case insensitive
ts 0 [ERROR] [MY-010172] [Server] failed to set datadir to /usr/local/mysql-8.0.13-macos10.14-x86_64/data/
ts 0 [ERROR] [MY-010119] [Server] Aborting
ts 0 [System] [MY-010910] [Server] /usr/local/mysql-8.0.13-macos10.14-x86_64/bin/mysqld: Shutdown complete (mysqld 8.0.13) MySQL Community Server - GPL.
ts is the UTC timestamp.
Is the problem that the command mysqld comes from /usr/local/mysql/ and the directory to write to /usr/local/mysql-8.0.13...../data/? Does my user on my work computer not have the correct permissions to write to these directories?
I've tried sudo:
Please read "Security" section of the manual to find out how to run mysqld as root!
Restart computer.
If that doesn't work:
If you are in a virtualenv try installing required python-to-mysql libraries globally, that also helped.
The final thing to try is
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib/:${DYLD_LIBRARY_PATH}"

OS errno 13 - Permission Denied MySQL Server

I'm having issues with MySQL workbench - I can't seem to start the server. In the command line, I navigate to:
C:\Program Files\MySQL\MySQL Server 8.0\bin\
And then run mysqld --initialize
I get the following error:
mysqld: Can't create directory 'C:\Program Files\MySQL\MySQL Server 8.0\data\' (OS errno 13 - Permission denied)
2018-12-10T23:18:55.211840Z 0 [System] [MY-013169] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.11) initializing of server in progress as process 36568
2018-12-10T23:18:55.227851Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-10T23:18:55.230796Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.11) MySQL Community Server - GPL.
Can anyone tell me how to fix this issue? I already checked the permissions on the MySQL Server 8.0 folder, and have set all the permissions to Allow.
You have to give writing permissions to the following folders:
PATH/DATA/
PATH/QUERIES/
PATH/LOG/
for the user who starts the MySQL windows service, which if not a special one you created and use for such purpose, is NETWORK SERVICE.

MySQL: mysqld in cmd returns "Can't change dir to..."

I've just joined to ask for help regarding this.
Whenever I type mysqld in CMD I get the following:
mysqld: Can't change dir to 'c:\Program Files\MySQL\MySQL Server 8.0\data\' (OS
errno 2 - No such file or directory)
2018-08-12T09:16:41.903311Z 0 [System] [MY-010116] [Server] c:\Program Files\MyS
QL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.12) starting as process 2740
2018-08-12T09:16:41.965711Z 0 [Warning] [MY-010091] [Server] Can't create test f
ile c:\Program Files\MySQL\MySQL Server 8.0\data\Moonwilles-PC.lower-test
2018-08-12T09:16:41.965711Z 0 [Warning] [MY-010091] [Server] Can't create test f
ile c:\Program Files\MySQL\MySQL Server 8.0\data\Moonwilles-PC.lower-test
2018-08-12T09:16:41.965711Z 0 [ERROR] [MY-010172] [Server] failed to set datadir
to c:\Program Files\MySQL\MySQL Server 8.0\data\
2018-08-12T09:16:41.965711Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-08-12T09:16:41.965711Z 0 [System] [MY-010910] [Server] c:\Program Files\MyS
QL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.12) MySQL Com
munity Server - GPL.
I've looked literally everywhere, I installed MySQL using the MySQL installer on 3 different computers, I got the same problem on all of them. This is the most ridiculous and frustrating thing I've ever encountered.
The MySQL service is on.
I tried typing mysqld --initialize and it seems to have made things worse as whenever I type 'mysqld' CMD now 'freezes' momentarily before actually executing the command.
The 'my.ini' file is setup correctly.
The data directory is in 'C:\ProgramData\MySQL\MySQL Server 8.0\Data'.
I've forgotten my root password and I am trying to recover it. I followed the guide found here: https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html and it's not even working.
I cannot log in to phpMyAdmin anymore.