MySql installation database initialization error - mysql

Im getting an error in the apply configuration part in the mySql installer community edition, it simply gives me and error after i execute with initializing the database, here is the log:
Beginning configuration step: Writing configuration file
Ended configuration step: Writing configuration file
Beginning configuration step: Updating Windows Firewall rules
Attempting to delete a Windows Firewall rule with command: netsh.exe advfirewall firewall delete rule name="Port 3306" protocol=TCP localport=3306
Deleted 1 rule(s).
Ok.
Adding a Windows Firewall rule for MySQL80 on port 3306.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 3306" protocol=TCP localport=3306 dir=in action=allow
Ok.
Successfully added the Windows Firewall rule.
Ended configuration step: Updating Windows Firewall rules
Beginning configuration step: Adjusting Windows service
Attempting to grant Network Service require filesystem permissions.
Granted permissions.
Updating existing service
Existing service updated
Ended configuration step: Adjusting Windows service
Beginning configuration step: Initializing Database
Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 8.0.11...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on...
2018-07-06T00:43:22.829759Z 0 [ERROR] [MY-011071] [Server] Unknown suffix '.' used for variable 'lower_case_table_names' (value '0.0')
2018-07-06T00:43:22.829791Z 0 [ERROR] [MY-011071] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Error while setting value '0.0' to 'lower_case_table_names'
2018-07-06T00:43:22.830226Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-07-06T00:43:22.830354Z 0 [Note] [MY-010120] [Server] Binlog end
Process for mysqld, with ID 12256, was run successfully and exited with code 1.
Failed to start process for MySQL Server 8.0.11.
Database initialization failed.
Ended configuration step: Initializing Database
I would appreciate a reply soon, i kind of need it working now.

I was also getting this issue
Updating Windows Firewall rules Attempting to delete a Windows Firewall rule with the command: netsh.exe advfirewall firewall delete rule name="Port 3306" protocol=TCP localport=3306".
The thing which worked for me is: In the step of the installation, when we have to choose the directory, like: C:\Program Files\MySQL and C:\ProgramData\MySQL for the setup, at this stage we get warnings like this directory has some existing files or it is not free. What I did is I cleared that directory first, then the warning message disappeared from this step and then I continue the installation procedure, and it worked for me. Hope it will work for you as well

This is a Bug in the Installer of 8.0.11. There are changes in the lower_case_table_names variable in the new release. See:
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-11.html
Nobody can fix this. If you installing the Server the configfile is write before new. Every time. So if you fix this 0.0 to 0 in my.ini the changes will be overwritten.
Somebody have to report a this bug to MySql.
(I am copy pasting from another thread. Having the same issue myself)

Related

error initializing database (may take a long time) mysql server

I'm trying installing MySQL server 8.0 (with error) and then uninstall it and trying to install 5.7 instead (I read people can get it works with 5.7) and the result is the same error. I don't know about the problem cause this is my first time using MySQL to learn it and stuck at the installation process. Here's the log of the installation process:
Beginning configuration step: Writing configuration file
Saving my.ini configuration file...
Saved my.ini configuration file.
Ended configuration step: Writing configuration file
Beginning configuration step: Updating Windows Firewall rules
Adding a Windows Firewall rule for MySQL57 on port 3306.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 3306" protocol=TCP localport=3306 dir=in action=allow
Ok.
Successfully added the Windows Firewall rule.
Ended configuration step: Updating Windows Firewall rules
Beginning configuration step: Adjusting Windows service
Attempting to grant Network Service require filesystem permissions.
Granted permissions.
Adding new service
New service added
Ended configuration step: Adjusting Windows service
Beginning configuration step: Initializing database (may take a long time)
Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 5.7.29...
Starting process with command: C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" --console --initialize-insecure=on --lower-case-table-names=1...
2020-02-14T10:43:06.401608Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-02-14T10:43:06.401673Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2020-02-14T10:43:06.408061Z 0 [ERROR] InnoDB: Unable to create temporary file; errno: 0
2020-02-14T10:43:06.408344Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2020-02-14T10:43:06.408444Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-02-14T10:43:06.408532Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-02-14T10:43:06.408617Z 0 [ERROR] Failed to initialize builtin plugins.
2020-02-14T10:43:06.408711Z 0 [ERROR] Aborting
Process for mysqld, with ID 15120, was run successfully and exited with code 1.
Failed to start process for MySQL Server 5.7.29.
Database initialization failed.
Ended configuration step: Initializing database (may take a long time)
anyone knows what's the problem?

MySQL 8.0 'C:\Program Files\MySQL\MySQL Server 8.0\data\' (OS errno 2 - No such file or directory) - can't find data for db from cmd

So, I'm looking to start a MYSQL server using CMD, and do some small simple tasks on it (hence why I'm using it that way and not a GUI)
I was told the best method for this, would be to run this command:
C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqld --console --standalone
Which I did, however, I am getting this error:
C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqld --console --standalone
mysqld: Can't change dir to 'C:\Program Files\MySQL\MySQL Server 8.0\data\'
(OS errno 2 - No such file or directory)
2018-10-30T17:43:27.385678Z 0 [System] [MY-010116] [Server] C:\Program
Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.12) starting as
process 4676
2018-10-30T17:43:27.420966Z 0 [Warning] [MY-010091] [Server] Can't create
test file C:\Program Files\MySQL\MySQL Server 8.0\data\DESKTOP-
HITD28G.lower-test
2018-10-30T17:43:27.421409Z 0 [Warning] [MY-010091] [Server] Can't create
test file C:\Program Files\MySQL\MySQL Server 8.0\data\DESKTOP-
HITD28G.lower-test
2018-10-30T17:43:27.423273Z 0 [ERROR] [MY-010172] [Server] failed to set
datadir to C:\Program Files\MySQL\MySQL Server 8.0\data\
2018-10-30T17:43:27.434694Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-10-30T17:43:27.442047Z 0 [System] [MY-010910] [Server] C:\Program
Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld
8.0.12) MySQL Community Server - GPL.
I have MySQL 8.0 installed, with the server, workbench etc, but apparently the data isn't there.
Have I installed it wrongly then?
While installing MySQL 8.0 via Windows Installer, in the configuration step, the installer puts the configuration file my.ini at location C:\ProgramData\MySQL\MySQL Server 8.0 and sets the variable defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini for mysqld command.
defaults-file just points to the file from where the server reads the default configuration settings when it actually gets started. Read more here.
Now, there are actually two ways to start the server without the GUI requirement.
Method 1: Running the server using installed Windows service
Either start, stop and restart the MySQL80 service through Services app or use net commands in cmd to do the same.
(As pointed out by #nonNumericalFloat)
Method 2:
(This actually worked for me)
The MySQL80 service starts the mysqld.exe executable which actually points to the configuration file, my.ini and to the defaults-file variable as evident by the Path to executable field under the Properties tab of the service.
So using the mysqld command alone is not sufficient as it neither provides the path to the default option file needed by the server during startup which the MySQL80 service provides (as described before) nor it provides the right location of data folder (which is also specified within my.ini by datadir) . Thus, the right command to run the server is as follows:
mysqld --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console
Also, because when mysqld is used alone, it tries to find the data folder in C:\Program Files\MySQL\MySQL Server 8.0\data which actually is not present, instead of setting defaults-file, datadir can be set to point to the right data folder location using the following command:
mysqld --datadir="C:\ProgramData\MySQL\MySQL Server 8.0\Data" --console
(Similar workaround mentioned by keerthiprasath)
console parameter is used to show any error and/or status messages while the command is being executed.
Another point to note that within the my.ini file, it is specified that under "Installation Instructions",
# On Windows you should keep this file in the installation directory
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y).
So after copying my.ini file from C:\ProgramData\MySQL\MySQL Server 8.0 to C:\Program Files\MySQL\MySQL Server 8.0, mysqld --console alone works fine.
Note:
Commands in method 2 only works when cmd is granted with administrative privileges.
Also, PATH needs to be set for easier invocations of the MySQL programs.
I was facing the same problem; Apparently, after shutting down my server I was not able to start it anymore.
The Server itself was installed as a service - named "mysql" by default. I did not remember renaming it to something else, so I could not start the right service.
Try installing it as a service
Start cmd
Go to the "C:\Program Files\MySQL\MySQL Server 5.6\bin"
type mysqld --install
then start the service:
METHOD #1: Access the Installed Service
Open up the Services app in the Control Panel &
Scroll alphabetically to the MySQL service:
Right click the service
Click Start Service
METHOD #2: Command Line Execution
Open DOS Window From the C: Prompt and run this:
net start mysql or net start mysql57. The right name may
vary on your system
For further information on installing or removing the service check the MySQL docs.

the configuration for mysql has failed?

Beginning configuration step: Writing configuration file
Ended configuration step: Writing configuration file
Beginning configuration step: Updating Windows Firewall rules
Attempting to delete a Windows Firewall rule with command: netsh.exe advfirewall firewall delete rule name="Port 33086" protocol=TCP localport=33086
No rules match the specified criteria.
An error occurred running netsh.exe delete:
The netsh.exe process did not return any error. Review the application log to see if there is a trace of the error.
The attempt to delete a Windows Firewall rule failed.
You can add or delete a Windows Firewall rule manually by following the instructions at this URL:
http://windows.microsoft.com/en-US/windows-vista/Allow-a-program-to-communicate-through-Windows-Firewall
Adding a Windows Firewall rule for MYSQL80 on port 33060.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 33060" protocol=TCP localport=33060 dir=in action=allow
Ok.
Successfully added the Windows Firewall rule.
Ended configuration step: Updating Windows Firewall rules
Beginning configuration step: Adjusting Windows service
Attempting to grant Network Service require filesystem permissions.
Granted permissions.
Updating existing service
Existing service updated
Ended configuration step: Adjusting Windows service
Beginning configuration step: Initializing Database
Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 8.0.11...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on...
2018-06-29T03:19:19.775981Z 0 [Warning] [MY-011071] [Server] option 'read_buffer_size': unsigned value 0 adjusted to 8192
2018-06-29T03:19:19.776028Z 0 [Warning] [MY-011071] [Server] option 'read_rnd_buffer_size': unsigned value 0 adjusted to 1
2018-06-29T03:19:19.776087Z 0 [ERROR] [MY-011071] [Server] Unknown suffix '.' used for variable 'lower_case_table_names' (value '0.0')
2018-06-29T03:19:19.776097Z 0 [ERROR] [MY-011071] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Error while setting value '0.0' to 'lower_case_table_names'
2018-06-29T03:19:19.776900Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-06-29T03:19:19.777077Z 0 [Note] [MY-010120] [Server] Binlog end
Process for mysqld, with ID 3752, was run successfully and exited with code 1.

Initializing database failed in MySQL server 8.0.111 on windows 7 64

I'm trying to create MySql Server version 8.0.11 on Windows 7 64bit , I got this :
Here are the logs :
Beginning configuration step: Writing configuration file
Ended configuration step: Writing configuration file
Beginning configuration step: Updating Windows Firewall rules
Attempting to delete a Windows Firewall rule with command: netsh.exe advfirewall firewall delete rule name="Port 5050" protocol=TCP localport=5050
Deleted 2 rule(s).
Ok.
Adding a Windows Firewall rule for MySQL80 on port 5050.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 5050" protocol=TCP localport=5050 dir=in action=allow
Ok.
Successfully added the Windows Firewall rule.
Ended configuration step: Updating Windows Firewall rules
Beginning configuration step: Adjusting Windows service
Attempting to grant Network Service require filesystem permissions.
Granted permissions.
Updating existing service
Existing service updated
Ended configuration step: Adjusting Windows service
Beginning configuration step: Initializing Database
Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 8.0.11...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on...
2018-07-02T23:37:38.137575Z 0 [ERROR] [MY-011071] [Server] Unknown suffix '.' used for variable 'lower_case_table_names' (value '0.0')
2018-07-02T23:37:38.137575Z 0 [ERROR] [MY-011071] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Error while setting value '0.0' to 'lower_case_table_names'
2018-07-02T23:37:38.137575Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-07-02T23:37:38.137575Z 0 [Note] [MY-010120] [Server] Binlog end
Process for mysqld, with ID 6256, was run successfully and exited with code 1.
Failed to start process for MySQL Server 8.0.11.
Database initialization failed.
Ended configuration step: Initializing Database
Can't find from this log if the error is MySql error or something wrong with my windows.
Solved, Just uninstalled everything that belongs to myseql .. restart my pc and installed again but this time I agreed to let the installer get the latest updates .. it worked
For me what worked was that in the installation step, instead of proceeding with the "Developer Default" in the "Choosing as Setup Type" section, I proceeded with the "Full" version. Also, note that in the "Accounts and Roles" section I did "add a user". Then everything worked out well; hope it helps someone.

MySQL Installer Stucks on "Starting Service"

I had problem with updating my last version of MySQL, so I removed everyting and just wanted to install a refresh version of the new MySQL 5.7, The problem is that it doesn't let me to install any version of that anymore. all of them stuck on configuration on starting service. I have already tried whatever I found on google but... NOTHING.
Here is the Log:
Beginning configuration step: Stopping Server [if necessary]
Ended configuration step: Stopping Server [if necessary]
Beginning configuration step: Writing configuration file
Ended configuration step: Writing configuration file
Beginning configuration step: Updating firewall
Adding firewall rule for MySQL57 on port 3306.
Successfully added firewall rule.
Ended configuration step: Updating firewall
Beginning configuration step: Adjusting Windows service [if necessary]
Attempting to grant Network Service require filesystem permissions.
Granted permissions.
Adding new service
New service added
Ended configuration step: Adjusting Windows service [if necessary]
Beginning configuration step: Initializing Database [if necessary]
Deleting Data folder shipped
Attempting to run MySQL Server with --Initialize-insecure
Running process: C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe -- defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" --initialize- insecure=on --console
Waiting for the server stops: C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" --initialize-insecure=on --console
2015-12-19T18:45:25.297629Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-12-19T18:45:25.297629Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2015-12-19T18:45:26.485174Z 0 [Warning] InnoDB: New log files created, LSN=45790
2015-12-19T18:45:26.688242Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-12-19T18:45:26.797633Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: ab7fc704-a680-11e5-8978-4c0bbe100c76.
2015-12-19T18:45:26.813276Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2015-12-19T18:45:26.813276Z 1 [Warning] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
Finished initialize database
Ended configuration step: Initializing Database [if necessary]
Beginning configuration step: Starting Server
Starting MySQL as a service