Running mysql_ssl_rsa_setup generates an error - mysql

In Windows Server 2008, I was running the program with following command:
E:\Program Files\MySQL\MySQL Server 5.7\bin>mysql_ssl_rsa_setup --datadir="E:\Program Files\MySQL\MySQL Server 5.7\SSL"
It returns this error:
Unable to load config info from "C:\Program Files (x86)\Common Files\ibm\icc\cimom\bin\openssl.cnf"
2018-01-17 10:45:51 [ERROR] Error generating ca_key.pem and ca_req.pem
The user account has full control to the path. Please help out.

Related

C Programming fatal error my sql.h no file or such directory on code blocks

I'm unable to use mysql on C when I do #include <mysql.h> or #include "mysql.h". Every time I try to run this program, I get a fatal error.
I put these as my linker settings to add the sql library :
C:\Program Files\MySQL\Connector C++ 8.0\libmysqlclient.so
C:\Program Files\MySQL\MySQL Server 8.0
also this is my search directories:
C:\Program Files\MySQL\Connector C++ 8.0
C:\Program Files\MySQL\MySQL Server 8.0
Any idea how to make codeblocks work with this?
Thanks and I'll keep searching too.
In looking for the answer, I found it. So instead of doing what I did in the link and search directories, instead do this:
Linker settings:
"C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib"
"C:\Program Files\MySQL\MySQL Server 8.0\lib\mysqlclient.lib"
Search Directores:
"C:\Program Files\MySQL\MySQL Server 8.0\lib"
"C:\Program Files\MySQL\MySQL Server 8.0\include"
This allowed me to compile the code with no errors

Error during MySQL Installation ("Initializing database" Failure)

During the last steps of the installation of MySQL Community Server (Apply Configurations) in Windows 10, I get an error initializing the database. This is the Log :
Beginning configuration step: Initializing database (may take a long
time) Attempting to run MySQL Server with --initialize-insecure
option... Starting process for MySQL Server 8.0.25... 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 --lower-case-table-names=1... mysqld: Can't get stat of
'C:\Users\Public\Documents\Wondershare\CreatorTemp' (OS errno 2 - No
such file or directory) '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. The
designated data directory C:\ProgramData\MySQL\MySQL Server 8.0\Data
is unusable. You can remove all files that the server added to it.
Aborting Process for mysqld, with ID 11240, was run successfully and
exited with code 1. Failed to start process for MySQL Server 8.0.25.
Database initialization failed. Ended configuration step: Initializing
database (may take a long time)
What can I do to solve this problem? Thanks.
I have the same question a few months ago and then yesterday I decided to just create the directory shown in the error log similar to yours and everything works fine now.....
All I did is I opened the command prompt, change the directory by typing: cd C:\Users\Public\Documents then enter......
After then directory has changed I then typed: mkdir Wondershare\CreatorTemp and Enter.
After I click execute in mysql installation everything works fine......

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.

Can't create test file lower test start server mysql

I'm following this tutorial here on creating a JDBC programming. I've followed the steps up to the console command to start the server:
// For Windows
cd {path-to-mysql-bin} // Check your MySQL installed directory
mysqld --console
I get the following error message:
mysqld: Can't change dir to 'C:\Program Files\MySQL\MySQL Server 5.7\data\' (Errcode: 2 - No such file or directory)
2017-01-06T10:54:36.968210Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-01-06T10:54:36.968210Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2017-01-06T10:54:36.968210Z 0 [Note] mysqld (mysqld 5.7.17) starting as process 11248 ...
2017-01-06T10:54:36.974226Z 0 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.7\data\DESKTOP-DEQ2IC2.lower-test
2017-01-06T10:54:36.975229Z 0 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.7\data\DESKTOP-DEQ2IC2.lower-test
2017-01-06T10:54:36.975229Z 0 [ERROR] failed to set datadir to C:\Program Files\MySQL\MySQL Server 5.7\data\
2017-01-06T10:54:36.976231Z 0 [ERROR] Aborting
2017-01-06T10:54:36.977234Z 0 [Note] Binlog end
2017-01-06T10:54:36.978237Z 0 [Note] mysqld: Shutdown complete
I'm quite new to using MySql in this way but I can see that there is no data folder in the server directory and no my.ini file which I assumes holds the config information on where the data directory is. I've also insntalled MySql using the windows installer which I've read could be why there is no my.ini file and just a template my-default.ini file.
Does anyone know why this is happening?
Create a data folder in C:\Program Files\MySQL\MySQL Server 8.0.
Create a new file with
(ALTER USER 'root'#'localhost' IDENTIFIED BY 'MyNewPass';)
command for password reset (if required)
Make sure that your file is in C: drive. root folder.
Then execute the below command:
C:\> cd "C:\Program Files\MySQL\MySQL Server 8.0\bin"
C:\> mysqld --init-file=C:\\mysql-init.txt
As mentioned above, create a "data" folder, (for me after that it didn't show errors, but it wasn't stills starting).
After that, go to services.msc in windows and start it from there. Also set it to Automatic so it starts automatically whenever you start the windows.
It worked for me.
If you install MySQL using the MySQL installation wizard your executable path is where you installed. It's something like "C:\Program Files\MySQL\MySQL Server 8.0\bin". Your my.init file resides in ProgramData, and path for init file may be like "C:\ProgramData\MySQL\MySQL Server 8.0". If it's can't be viewed in the location, please check whether it's hide.
As in your error description "Can't create test file C:\Program Files\MySQL\MySQL Server 5.7\data...", It seems there is no folder named 'data' in MySQL installed location. Most probably It may reside where the 'my.init' file exists (ProgramData). Else may be the name of the folder not 'data' but 'Data'.
You can copy the Data folder from the location of init-file exist and paste to the executable location. Also, change the name of the folder to data if it's capitalized.
I ran the command bin\mysqld --initialize --console and everything was solved. In some cases the data folder should be created before.
There are different parameters for windows and the rest.
See the following links:
https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization.html
https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization.html#data-directory-initialization-password-assignment
https://dev.mysql.com/doc/refman/8.0/en/option-files.html
In my case, I installed MySQL with Windows installer on the D:/ drive and was set NOT to run as Windows service.
I managed to resolve the issue by moving my.ini from C:\ProgramData\MySQL\MySQL Server 8.0 to MySQL installation folder.
This error happens to me.
The solution was edit D:\Program Files\xampp\mysql\data\my.ini and change the directory to your D: path
[mysqld]
datadir=D:\program files\xampp\mysql\data
[client]
I could solve it; I had similar issues.
C:\Program Files\MySQL\MySQL Server 8.0\bin>**mysqld --console**
2021-02-27T23:46:09.919345Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.23) starting as process 7296
2021-02-27T23:46:09.926583Z 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-02-27T23:46:09.926798Z 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-02-27T23:46:09.927086Z 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-02-27T23:46:09.933751Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-02-27T23:46:09.934110Z 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.
The solution was that I needed to recreate the my.ini file in C:\ProgramData\MySQL\MySQL Server 8.0 and add to this:
[mysqld]
datadir=C:\ProgramData\MySQL\MySQL Server 8.0\Data
Set encoding to ANSI and saved the file.
Then the service could start:
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" MySQL80
Installing with a new MSI installer also didn't solve the issue, it kept hanging until I made the above mentioned adaptations.
In my case, the data folder did not exists, so I created one and things started working.
For xampp-portable-windows-x64-8.0.8-0-VS16
It worked by just putting at root of drive as mentioned in \ xampp \ readme_en.txt
NOTE: Unpack the package to your USB stick or a partition of your choice.
There it must be on the highest level like E:\ or W:\.
Hopes that helps
I stumbled on the same problem as mentioned at the beginning of this thread, and the trick for me was to run my console on Administrator mode (windows).
The error messages related to things like "can't find the folder" etc.., were due to the unability for the program to create, on demand, such folders and files.
Cheers
That happened to me when I try to launch the server without being in admin mode. Try relaunching console in admin mode and then navigate to the sql server 8.0 directory before trying again

reset root mysql on windows

Following the recommended instructions for resetting root at link and the other recommendations here at stackoverflow. I tried to reset my root pass both ways suggested, with and without the --defaults-file option
First I tried.
"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" –init-file=C:\\mysql-init.txt --console
Error:
C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld: Too many arguments (first extra is 'ûinit-file=C:\mysql-init.txt').
Next I tried
"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --defaults-file="C:\\ProgramData\\MySQL\\MySQL Server 5.5\\my.ini" MySQL55 –init-file=C:\\mysql-init.txt --console
Error:
C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld: Too many arguments (first ex
tra is 'MySQL55').
'Too many arguments' makes me think my syntax is the problem
Look at your command lines again and manually delete the LONG HYPHENS. Then type the hyphens in again manually.
"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" –init-file=C:\mysql-init.txt --console
should be
"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --init-file=C:\mysql-init.txt --console
(notice the hyphens before init-file)
Refer to mysqld options
I uninstalled the MySQL server.
I went to the mysql folder, and erased everything (the folder too).
Reboot the PC.
Reinstall the MySQL.
Set the new password.