None of the solutions suggested to reduce MySQL's ft_min_word_len works for me on Windows 7 Pro.
In Control Panel Services the path to MySQL56 server executable reads "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" MySQL56
Both files at "C:\windows\my.ini" and at "C:\Program Files\MySQL\MySQL Server 5.6\my.ini" reads
[mysqld]
ft_min_word_len = 3
In MySQL, the query SHOW VARIABLES LIKE 'ft_min_word_len'; still shows 4!!!
My bad!!! I was changing the file at "C:\Windows\my.ini" and "C:\Program Files\MySQL\MySQL Server 5.6\my.ini" instead of the correct one at "C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" as per the path to MySQL56 server executable which reads "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" MySQL56.
Now working as expected!
Related
Windows 10/MySQL8.0/R/RStudio
I'm running MySQL as a Windows service.
I've read a couple of related post on this site the evening.
I created my.cnf file as suggested:
[mysql]
local-infile
I've the cnf file in The same directory as the exec., in the MySQL/etc directory, in my home directory and finally in C:\
What am I overlooking?
The key to resolving this issue is that I'm running MySQL as a Windows service. Windows services are managed by the services.msc program.
MySQL entry in services manager:
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini"
All we have to do is in the my.ini (remember in Windows config files are *.ini):
[mysqld]=1
local-infile=1
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.
I'm running mysql 5.7.17 on Windows 7 and I've found its configuration to be different than when I run from the docker image. More specifically, the docker image adds the ONLY_FULL_GROUP_BY mode, which the windows installation doesn't by default. I would like to add it in windows too (permanently, not just for the session). I've tried with this options:
[mysqld]
sql_mode="NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,ONLY_FULL_GROUP_BY"
and
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,ONLY_FULL_GROUP_BY
In C:\Program Files\MySQL\MySQL Server 5.7\my-default.ini (that's the only file the installation creates, but it is told in the comments not to edit it), C:\Program Files\MySQL\MySQL Server 5.7\my.ini and C:\Windows\my.ini. When I execute mysql --help I get this output:
Default options are read from the following files in the given order:
C:\windows\my.ini C:\windows\my.cnf C:\my.ini C:\my.cnf C:\Program
Files\MySQL\M ySQL Server 5.7\my.ini C:\Program Files\MySQL\MySQL
Server 5.7\my.cnf
I've got nothing related in C:\.
But the server seems not to pick the sql mode. When I query for SELECT ##sql_mode and SELECT ##global.sql_mode I only get STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION.
From the Mysql docs:
On Windows, MySQL Installer interacts with the user and creates a file named my.ini in the base installation directory as the default option file. If you install on Windows from a Zip archive, you can copy the my-default.ini template file in the base installation directory to my.ini and use the latter as the default option file.
But again, I only got my-default.ini created.
Also the error message in xampp control panel states:
Found Path: "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.5\my.ini" MySQL
20:08:20 [mysql]
Expected Path: c:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysql
Can you help as this is a fresh install of xampp v.3.2.1
I followed the instructions on install I don't know why it's not working.
Do I need to change the path in the httpd.conf file in mysql for it to find the path?
It looks mysql is already installed in your system in the above mentioned "Found Path". If already installed mysql is not needed, uninstall it. Now try to run our new Xampp mysql server, it will run. Otherwise you can run the xampp mysql using "mysql_start" batch file which is under XAMPP folder.
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.