Error in MySQL v5.7.11 installation after compiling - mysql

I am getting following error in MAC OS X 10.11 while trying to start mysql server after installation from source code compilation.
keyring_file is not readable.
I have tried to start server using following command.
./mysqld start
Following error is generated in terminal.
2016-03-24T18:43:50.591772Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-03-24T18:43:50.592053Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2016-03-24T18:43:50.592091Z 0 [Note] ./mysqld (mysqld 5.7.11) starting as process 3470 ...
2016-03-24T18:43:50.593833Z 0 [Warning] Can't create test file /usr/local/mysql/data/Hemens-MacBook-Pro-2.lower-test
2016-03-24T18:43:50.593852Z 0 [Warning] Can't create test file /usr/local/mysql/data/Hemens-MacBook-Pro-2.lower-test
2016-03-24T18:43:50.595428Z 0 [ERROR] Plugin keyring_file reported: 'keyring_file initialization failure. Please check if the keyring_file_data points to readable keyring file or keyring file can be created in the specified location. The keyring_file will stay unusable until correct path to the keyring file gets provided'
2016-03-24T18:43:50.595860Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-03-24T18:43:50.595866Z 0 [Note] InnoDB: Uses event mutexes
2016-03-24T18:43:50.595881Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-03-24T18:43:50.595884Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-03-24T18:43:50.596157Z 0 [Note] InnoDB: Number of pools: 1
2016-03-24T18:43:50.596319Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-03-24T18:43:50.605257Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-03-24T18:43:50.615154Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-03-24T18:43:50.631296Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-03-24T18:43:50.638315Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-03-24T18:43:50.638358Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2016-03-24T18:43:50.638364Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2016-03-24T18:43:50.638369Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2016-03-24T18:43:50.638373Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2016-03-24T18:43:50.638377Z 0 [ERROR] InnoDB: Cannot open datafile './ibtmp1'
2016-03-24T18:43:50.638381Z 0 [ERROR] InnoDB: Unable to create the shared innodb_temporary
2016-03-24T18:43:50.638385Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file
2016-03-24T18:43:50.954042Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2016-03-24T18:43:50.954098Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-03-24T18:43:50.954119Z 0 [ERROR] Failed to initialize plugins.
2016-03-24T18:43:50.954126Z 0 [ERROR] Aborting
2016-03-24T18:43:50.954141Z 0 [Note] Binlog end
2016-03-24T18:43:50.954223Z 0 [Note] Shutting down plugin 'CSV'
2016-03-24T18:43:50.954232Z 0 [Note] Shutting down plugin 'keyring_file'
2016-03-24T18:43:50.954507Z 0 [Note] ./mysqld: Shutdown complete

If you check the keyring_file_data mysql manual entry you will see what this option means:
The path name of the data file used for secure data storage by the
keyring_file plugin. The file location should be in a directory
considered for use only by the keyring_file plugin. For example, do
not locate the file under the data directory.
Do not use the same keyring_file data file for multiple MySQL
instances. Each instance should have its own unique data file.
The default file name is keyring, located in a directory that is
platform specific and depends on the value of the INSTALL_LAYOUT CMake
option, as shown in the following table. To specify the default
directory for the file explicitly if you are building from source, use
the INSTALL_MYSQLKEYRINGDIR CMake option.
You will also see a default value how various Linux distributions handle it.
/var/lib/mysql-keyring/keyring
So the answer should be it is safe to ignore. However should you wish innodb file encryption my.cnf should look something like this:
[mysqld]
keyring_file_data = /var/lib/mysql-keyring/keyring
However this probably won't solve your problem.
it's a question not belonging to stackoverflow but perhaps serverfault.
it's a permissions issue. Did you chown the mysql data directory to the user mysqld is running under?

Related

Error: MySQL shutdown unexpectedly XAMPP Plugin 'InnoDB' init function returned error [duplicate]

I restarted my server because it froze (probably the stupidest thing I did so far) and then got some internal server errors. I soon discovered that mysql had failed on startup (service mysql status).
I read the mysql error log( Pastebin ) and started googling.
I'm running Ubuntu at its latest version, mysql Ver 14.14 Distrib 5.7.31, for Linux (x86_64) using EditLine wrapper.
What I tried:
deleting both ib_logfile (after doing a backup) in /var/lib/mysql
apt-get upgrade (I really don't know why)
-checking my.cf for errors
Here is my /var/log/mysql/error.log
2020-08-07T15:43:06.094116Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-08-07T15:43:06.095903Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.31-0ubuntu0.18.04.1) starting as process 952 ...
2020-08-07T15:43:06.100450Z 0 [Note] InnoDB: PUNCH HOLE support available
2020-08-07T15:43:06.100482Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-08-07T15:43:06.100489Z 0 [Note] InnoDB: Uses event mutexes
2020-08-07T15:43:06.100496Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2020-08-07T15:43:06.100502Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-08-07T15:43:06.100508Z 0 [Note] InnoDB: Using Linux native AIO
2020-08-07T15:43:06.100771Z 0 [Note] InnoDB: Number of pools: 1
2020-08-07T15:43:06.100876Z 0 [Note] InnoDB: Using CPU crc32 instructions
2020-08-07T15:43:06.102827Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-08-07T15:43:06.112754Z 0 [Note] InnoDB: Completed initialization of buffer pool
2020-08-07T15:43:06.114871Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-08-07T15:43:06.127135Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2020-08-07T15:43:06.128655Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 7945493345
2020-08-07T15:43:06.128723Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 7945545114
2020-08-07T15:43:06.130551Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 7945493345 and the end 7945545114.
2020-08-07T15:43:06.130573Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2020-08-07T15:43:06.732437Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-08-07T15:43:06.732470Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-08-07T15:43:06.732482Z 0 [ERROR] Failed to initialize builtin plugins.
2020-08-07T15:43:06.732491Z 0 [ERROR] Aborting
2020-08-07T15:43:06.732526Z 0 [Note] Binlog end
2020-08-07T15:43:06.732586Z 0 [Note] Shutting down plugin 'CSV'
2020-08-07T15:43:06.732959Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
If you need more logs/informations, I will provide them.
Thanks, I'm really desperate, I really don't want to loose the past 2 years of my life.
For MYSQL not starting in XAMP
Here is a good fix that worked for me
Navigate to /var/lib/mysql.
If you see log files like, ib_logfile0 and ib_logfile1, rename or
move them to some other folder.
Stop and start the MySQL service.
That`s all.
Before deleting ib_logfile0, ib_logfile1 and ibdata1, I started mysql in InnoDB recovery mod 4 and logged in to phpmyadmin to backup all of my databases. After that I removed the ib files, purged mysql and phpmyadmin, reinstalled them, reconfigured mysql, logged into phpmyadmin and imported my databases.

MySQL docker: Import schema file with error: inet addr:'| cut -d: -f2 | awk '{ print $1}'", "commandName": "IP"}], "clamAvInt'

I am working with MySQL docker image version 5.7 with initialize the data by the schema file but got some error can't solve.
My docker command line is:
docker run --name mysql -e MYSQL_ROOT_PASSWORD='abc123' -v /Users/jenkins/Desktop/irms:/docker-entrypoint-initdb.d mysql:5.7
and get the error, the log as below:
$ docker run --name mysql -e MYSQL_ROOT_PASSWORD='abc123' -v /Users/jenkins/Desktop/irms:/docker-entrypoint-initdb.d mysql:5.7
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
2021-03-17 02:05:15+00:00 [Note] [Entrypoint]: Initializing database files
2021-03-17T02:05:15.606058Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-03-17T02:05:15.756090Z 0 [Warning] InnoDB: New log files created, LSN=45790
2021-03-17T02:05:15.779384Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2021-03-17T02:05:15.837663Z 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: 373d4ffb-86c5-11eb-8780-0242ac110002.
2021-03-17T02:05:15.839186Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-03-17T02:05:16.450734Z 0 [Warning] CA certificate ca.pem is self signed.
2021-03-17T02:05:16.576740Z 1 [Warning] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2021-03-17 02:05:18+00:00 [Note] [Entrypoint]: Database files initialized
2021-03-17 02:05:18+00:00 [Note] [Entrypoint]: Starting temporary server
2021-03-17 02:05:18+00:00 [Note] [Entrypoint]: Waiting for server startup
2021-03-17T02:05:18.819727Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-03-17T02:05:18.820623Z 0 [Note] mysqld (mysqld 5.7.33) starting as process 78 ...
2021-03-17T02:05:18.822725Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-03-17T02:05:18.822772Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-03-17T02:05:18.822783Z 0 [Note] InnoDB: Uses event mutexes
2021-03-17T02:05:18.822789Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-03-17T02:05:18.822795Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-03-17T02:05:18.822800Z 0 [Note] InnoDB: Using Linux native AIO
2021-03-17T02:05:18.823072Z 0 [Note] InnoDB: Number of pools: 1
2021-03-17T02:05:18.823301Z 0 [Note] InnoDB: Using CPU crc32 instructions
2021-03-17T02:05:18.824551Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-03-17T02:05:18.829149Z 0 [Note] InnoDB: Completed initialization of buffer pool
2021-03-17T02:05:18.830692Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-03-17T02:05:18.841912Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2021-03-17T02:05:18.846985Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-03-17T02:05:18.847098Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-03-17T02:05:18.862891Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-03-17T02:05:18.863475Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2021-03-17T02:05:18.863521Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2021-03-17T02:05:18.863960Z 0 [Note] InnoDB: Waiting for purge to start
2021-03-17T02:05:18.914486Z 0 [Note] InnoDB: 5.7.33 started; log sequence number 2746831
2021-03-17T02:05:18.915203Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2021-03-17T02:05:18.915523Z 0 [Note] Plugin 'FEDERATED' is disabled.
2021-03-17T02:05:18.916967Z 0 [Note] InnoDB: Buffer pool(s) load completed at 210317 2:05:18
2021-03-17T02:05:18.920098Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2021-03-17T02:05:18.920168Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2021-03-17T02:05:18.920570Z 0 [Warning] CA certificate ca.pem is self signed.
2021-03-17T02:05:18.920635Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2021-03-17T02:05:18.922497Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2021-03-17T02:05:18.926990Z 0 [Note] Event Scheduler: Loaded 0 events
2021-03-17T02:05:18.927219Z 0 [Note] mysqld: ready for connections.
Version: '5.7.33' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL)
2021-03-17 02:05:19+00:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
2021-03-17 02:05:20+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/IRMSDB_2021-03-09.sql
ERROR 1064 (42000) at line 287: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inet addr:'| cut -d: -f2 | awk '{ print $1}'", "commandName": "IP"}], "clamAvInt' at line 5
I checked my schema file and no idea what the error exactly and no idea how to fix it.
My schema file is exported from Sequel Pro.
Could you kindly provide some idea to solve the problem?
Thanks very much.
Just attached my schema file below, and please change the extension name from jpg to SQL.
Click here to download: MySQL schema file

Can no longer run mysql with homebrew

I had mysql running fine on my Mac running High Sierra, 10.13.5. Last night, however, the system rebooted in the middle of the night for some unknown reason and I haven't been able to get things back and running properly since.
When I run brew services start mysql I get:
Successfully startedmysql(label: homebrew.mxcl.mysql)
in response. However, ps aux | grep mysql shows no running server and I cannot log into mysql. If I run, mysql.server start I get:
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/iMac-5K-3.local.pid).
The error file contents are as follows:
2018-06-18T13:51:57.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/iMac-5K-3.local.pid ended
2018-06-18T13:52:07.6NZ mysqld_safe Logging to '/usr/local/var/mysql/iMac-5K-3.local.err'.
2018-06-18T13:52:07.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2018-06-18T13:52:07.837840Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-06-18T13:52:07.838096Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2018-06-18T13:52:07.838155Z 0 [Note] /usr/local/opt/mysql/bin/mysqld (mysqld 5.7.22) starting as process 8334 ...
2018-06-18T13:52:07.840681Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2018-06-18T13:52:07.841958Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-06-18T13:52:07.841975Z 0 [Note] InnoDB: Uses event mutexes
2018-06-18T13:52:07.841983Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-06-18T13:52:07.841990Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-06-18T13:52:07.842257Z 0 [Note] InnoDB: Number of pools: 1
2018-06-18T13:52:07.842356Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-06-18T13:52:07.843494Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-06-18T13:52:07.852043Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-06-18T13:52:07.901671Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-06-18T13:52:07.902006Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 2700829144 and the end 2700828672.
2018-06-18T13:52:07.902049Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-06-18T13:52:08.338717Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-06-18T13:52:08.338812Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-06-18T13:52:08.338823Z 0 [ERROR] Failed to initialize builtin plugins.
2018-06-18T13:52:08.338835Z 0 [ERROR] Aborting
2018-06-18T13:52:08.338849Z 0 [Note] Binlog end
2018-06-18T13:52:08.338929Z 0 [Note] Shutting down plugin 'CSV'
2018-06-18T13:52:08.339077Z 0 [Note] /usr/local/opt/mysql/bin/mysqld: Shutdown complete
2018-06-18T13:52:08.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/iMac-5K-3.local.pid ended
OK, found the solution here.
I didn't bother with step 1 since I don't have a master/slave setup. I just did:
mv /var/lib/mysql/ib_logfile* ~
I can now start mysql successfully.

MySQL57 service on Local Computer started and then stopped

I'm having a problem with mySql. It is stopped and when I try to start it, I get the following: "MySQL57 service on Local Computer started and then stopped." as you can see in the following image:
My server log is the following:
2017-04-05T10:04:58.085384Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-04-05T10:04:58.085384Z 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.
2017-04-05T10:04:58.087363Z 0 [Note] C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe (mysqld 5.7.9-log) starting as process 7852 ...
2017-04-05T10:04:58.108397Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2017-04-05T10:04:58.109398Z 0 [Note] InnoDB: Uses event mutexes
2017-04-05T10:04:58.109398Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2017-04-05T10:04:58.110399Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-04-05T10:04:58.110399Z 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB
2017-04-05T10:04:58.116403Z 0 [Note] InnoDB: Number of pools: 1
2017-04-05T10:04:58.116403Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2017-04-05T10:04:58.156434Z 0 [Note] InnoDB: Initializing buffer pool, total size = 8M, instances = 1, chunk size = 8M
2017-04-05T10:04:58.158435Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-04-05T10:04:58.200443Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-04-05T10:04:58.207479Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 43061044961
2017-04-05T10:04:58.208477Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 43061045173
2017-04-05T10:04:58.209476Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 43061044961 and the end 43061045173.
2017-04-05T10:04:58.210477Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2017-04-05T10:04:58.514809Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-04-05T10:04:58.515786Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-04-05T10:04:58.515786Z 0 [ERROR] Failed to initialize plugins.
2017-04-05T10:04:58.516785Z 0 [ERROR] Aborting
2017-04-05T10:04:58.517786Z 0 [Note] Binlog end
2017-04-05T10:04:58.517786Z 0 [Note] Shutting down plugin 'CSV'
2017-04-05T10:04:58.519788Z 0 [Note] C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe: Shutdown complete
I have tried, some options like turn off innodb_log_checksums via command line or set innodb_log_checksums = 0 in configure file. and then restart, or this one in stackoverflow but It is still stopped.
What can I do? Can some one help me?
Thank you
Run the command from the command prompt; it's the only effective way to see the error message that services return that you will not see using the built-in Windows Services program.
Either double-click the service or right-click to click on Properties.
Click on the Path to executable.
Press the Home key and then hold Shift while pressing the End key to highlight the entire command.
Hold the Control key and then press C to copy.
Run the command prompt (usually Start -> Run -> cmd -> Okay) or make a new shortcut and just type cmd for the command.
In the commend prompt right-click.
Left-click on paste.
Press Enter to run the command.
Research the problem with your preferred search engine, use "quote operators" around the error message to limit results if there are too many unrelated results.
Just had this problem, way i solved it was:
In the command prompt go to mysql location mysql\bin (use cd .. to go back one folder or cd name_of_folder to access it)
In this location, type mysqld --initialize
here what I did and it worked. MySQL keep backup of your my.ini files in C:\ProgramData\MySQL\MySQL Server 8.0 directory in windows, rename a recent backup of *.ini to my.ini

MySQL 5.7 on ReadOnlyMedia

I have to set up an MySQL, that is running on a read only media, like DVD or so.
Based on the document from MySql https://dev.mysql.com/doc/refman/5.7/en/innodb-read-only-instance.html it seems not so difficult.
But whith the configuration described, it's not possible to start the server from an ISO file.
My parameters to start the server:
mysql-5.7.17-win32\bin\mysqld.exe --no-defaults --console --port=3307 --innodb-read-only=1 --event-scheduler=disabled --innodb_change_buffering=none --innodb_flush_method=normal --pid-file=d:\mysql.pid
Unfortunately this isn't working.
I will get the log:
2017-02-24T18:23:33.913117Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-02-24T18:23:33.913117Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2017-02-24T18:23:33.914120Z 0 [Note] mysql-5.7.17-win32\bin\mysqld.exe (mysqld 5.7.17) starting as process 9468 ...
2017-02-24T18:23:33.916995Z 0 [Warning] Can't create test file G:\mysql-5.7.17-win32\data\MyComputer.lower-test
2017-02-24T18:23:33.917497Z 0 [Warning] Can't create test file G:\mysql-5.7.17-win32\data\MyComputer.lower-test
2017-02-24T18:23:33.919531Z 0 [Note] InnoDB: Started in read only mode
2017-02-24T18:23:33.919531Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2017-02-24T18:23:33.920004Z 0 [Note] InnoDB: Uses event mutexes
2017-02-24T18:23:33.920004Z 0 [Note] InnoDB: Memory barrier is not used
2017-02-24T18:23:33.920004Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-02-24T18:23:33.920504Z 0 [Note] InnoDB: Number of pools: 1
2017-02-24T18:23:33.921007Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2017-02-24T18:23:33.921007Z 0 [Note] InnoDB: Disabling background log and ibuf IO write threads.
2017-02-24T18:23:33.923041Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-02-24T18:23:33.928551Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-02-24T18:23:33.951319Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-02-24T18:23:34.109640Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-02-24T18:23:34.110647Z 0 [ERROR] InnoDB: Operating system error number 5 in a file operation.
2017-02-24T18:23:34.110647Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory. It may also be you have created a subdirectory of the same name as a data file.
2017-02-24T18:23:34.110647Z 0 [ERROR] InnoDB: Cannot open datafile '.\ibtmp1'
2017-02-24T18:23:34.110647Z 0 [ERROR] InnoDB: Unable to create the shared innodb_temporary
2017-02-24T18:23:34.110647Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file
2017-02-24T18:23:34.414731Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-02-24T18:23:34.414731Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-02-24T18:23:34.415619Z 0 [ERROR] Failed to initialize plugins.
2017-02-24T18:23:34.415619Z 0 [ERROR] Aborting
2017-02-24T18:23:34.416141Z 0 [Note] Binlog end
2017-02-24T18:23:34.416141Z 0 [Note] Shutting down plugin 'CSV'
2017-02-24T18:23:34.416640Z 0 [Note] mysql-5.7.17-win32\bin\mysqld.exe: Shutdown complete
It's correct that the shared tablespace could not be created. We are on a read only media.
But how can I avoid the creation of the shared tablespace or let it create in a temp folder on a readable media?
First, you need to create your instance on a writable media,
Do a slow shutdown as described in the reference document,
Copy/burn or whatever your database files to your "non-writable"
media
Change the configuration parameters to reflect the new configuration : datadir, innodb_data_home_dir, ....
Restart your instance
et voilĂ