I tried some similar questions but they didn't help me yet...
In xampp, I clicked Start on MySQL and it wrote to me:
'MySQL Service detected with wrong path Change XAMPP MySQL and Control
Panel settings or Uninstall/disable the other service manually first
Found Path: "C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin\mysqld"
--defaults-file="C:\Program Files (x86)\MySQL\MySQL Server 5.1\my.ini" MySQL Expected Path: c:\xampp\mysql\bin\mysqld.exe
--defaults-file=c:\xampp\mysql\bin\my.ini mysql'
When I clicked 'Start' again, it wrote:
'Attempting to start MySQL service...',
but nothing happened, just wrote this:
'There may be an error, return code: 1223 - The operation was canceled by the user.'
I'm new to this and really don't know what to do...
P.S: Apache works fine.
Thank you a lot!
Related
I was installing mysql server for a course, and I can't install it, please help.
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.31...
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...
Using jemalloc.dll for my_malloc and ut::malloc etc.
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Empty value for 'open_files_limit' specified.
Process for mysqld, with ID 7496, was run successfully and exited with code 1.
Failed to start process for MySQL Server 8.0.31.
Database initialization failed.
Ended configuration step: Initializing database (may take a long time)**
enter image description here
enter image description here
I've had the same problem, in my case I don't need the newest version, so to solve the problem i've had to download a Mysql Comunity Installer old version 5.7.27 to install the Mysql Server 5.7. Give it a try :)
In my case I could finally install it by:
Uninstalll everything
Restarted the system
Removed [ProgramData]\MySql folder
[Program Files (x86)]\MySql folder
Run the installer again
Skipped installer update
And installation succeed!
I am running windows 11 and installed version 8.0.31 with developer config.
I installed a MySQL server with installer and it started. After reboot I tried to start it again and get the error:
D:\Program Files\MySQL\MySQL Server 5.7\bin>mysqld -u root -p
mysqld: Can't change dir to 'D:\Program Files\MySQL\MySQL Server 5.7\data\' (Errcode: 2 - No such file or directory)
2015-11-17T08:30:18.822962Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-11-17T08:30:18.822962Z 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.
2015-11-17T08:30:18.822962Z 0 [Note] mysqld (mysqld 5.7.9) starting as process 1108 ...
2015-11-17T08:30:18.838586Z 0 [Warning] Can't create test file D:\Program Files\MySQL\MySQL Server 5.7\data\DESKTOP-RNBR3E8.lower-test
2015-11-17T08:30:18.838586Z 0 [Warning] Can't create test file D:\Program Files\MySQL\MySQL Server 5.7\data\DESKTOP-RNBR3E8.lower-test
2015-11-17T08:30:18.838586Z 0 [ERROR] failed to set datadir to D:\Program Files\MySQL\MySQL Server 5.7\data\
2015-11-17T08:30:18.838586Z 0 [ERROR] Aborting
2015-11-17T08:30:18.838586Z 0 [Note] Binlog end
2015-11-17T08:30:18.838586Z 0 [Note] mysqld: Shutdown complete
I tried to reinstall MySQL.
UPDATE:
When I run mysqld -u root -p as administrator, nothing happens.
I have met same problem. In my case I had no ..\data dir in my C:\mysql\ so I just executed mysqld --initialize command from c:\mysql\bin\ directory and I got the data directory in c:\mysql\data. Afterwards I could use mysqld.exe --console command to test the server startup.
Since you used the Windows installer, everything is set up for you to run MySQL 5.7 as a Windows service, which is a great option in most cases.
Instead of running mysqld.exe from the command line,
Win + R
Run services.msc
Right-click on MySQL57
Start the service.
In my case, I had installed the data directory to a different location. So the data directory really wasn't in the default location. Therefore, when I ran the mysqld command from the command prompt, I had to specify the data directory manually:
mysqld --datadir=D:/MySQLData/Data
Here's the documentation for mysqld command-line arguments.
First run
mysqld -u root --initialize-insecure
It will create data folder with root as user without password. Then run
mysqld.exe -u root --console
What I did (Windows 10) for a new installation:
Start cmd in admin mode (run as administrator by hitting windows key, typing cmd, right clicking on it and selecting "Run as Administrator"
Change into "MySQL Server X.Y" directory (for me the full path is C:\Program Files\MySQL\MySQL Server 5.7")
using notepad create a my.ini with a mysqld section that points at your data directory
[mysqld]
datadir="X:\Your Directory Path and Name"
created the directory identified in my.ini above.
change into bin Directory under server directory and execute:
mysqld --initialize
Once complete, started the service and it came up fine.
Check that the director exists.
If it exists make sure mysql has access rights on it (read/write). Can be a good idea to run MySQL as a system process, but not mandatory.
If this is stil not working try having the following notation with double slashes: C:\WebSerer\MySQL\data or C:/WebServer/MySQL/data
If you are having this issue and can't find the MySQL service either, just launch "MySQL Installer" from the Start menu (or download it), then choose "Reconfigure" on MySQL Server. Follow the steps to set a root user password and then the service will be created and started automatically (and set to auto-start on boot).
In mysql 8.0.13 zip package initializing.
Verify that data folder is empty.
Under the mysql bin path run
mysqld.exe --initialize-insecure
Add to my.ini native mysql
[mysqld]
default_authentication_plugin=mysql_native_password
When I encountered this same error, I noticed MySQL Configuration file in "C:\Program Files\MySQL\MySQL Server X.Y\" has changed to my-default.ini
I solved it by
Copy my.ini from "C:\ProgramData\MySQL\MySQL Server X.Y\my.ini"
Paste it in "C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
Restart MySQL Server from services.msc
In the .ini file, their is part that reads:
# On Windows you should keep this file in the installation directory
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
# make sure the server reads the config file use the startup option
# "--defaults-file".
Check your real my.ini file location and set --defaults-file="location" with this command
mysql --defaults-file="C:\MYSQL\my.ini" -u root -p
This solution is permanently for your cmd Screen.
remove all files in "{path-to-mysql}\data" directory and run:
mysqld --initialize-insecure --basedir={path-to-mysql}\mysql --datadir={path-to-mysql}\data --console
I don't know if it's your problem but try this...
For me, the version of my.ini which is created under "ProgramData\MySQL\MySQL Server [version]" wasn't read. I had to move it to "Program Files\MySQL\MySQL Server [version]".
RTS.
If you installed MySQL Server using the Windows installer and as a Window's service, then you can start MySQL Server using PowerShell and experience the convenience of not leaving the command line.
Open PowerShell and run the following command:
Get-Service *sql*
A list of MySQL services will be retrieved and displayed. Choose the one that you want and run the following command while replacing service-name with the actual service name:
Start-Service -Name service-name
Done. You can check that the service is running by running the command Get-Service *sql* again and checking the status of the service.
mariofertc completely solved this for me here are his steps:
Verify mysql's data directory is empty (before you delete it though, save the err file for your records).
Under the mysql bin path run:
mysqld.exe --initialize-insecure
add to my.ini (mysql's configuration file) the following:
[mysqld]
default_authentication_plugin=mysql_native_password
Then check services (via task manager) to make sure MySql is running, if not - right click MySql and start it.
I'll also note, if you don't have your mysql configuration file in the mysql bin and can't find it via the windows search, you will want to look for it in C:\Program Data\Mysql\ Note that it might be a different name other than my.ini, like a template, as Heesu mentions here: Can't find my.ini (mysql 5.7)
Just find the template that matches the version of your mysql via the command mysql --version
This solution uses the windows mysql installer.
I have tried every other way mentioned here and other related posts, but it did not solve my problem, the service just wont start, but the below approach with the mysql-installer did.
If you still have your installer or atleast remember the version then follow below steps:
Start your windows mysql installer. For me it was "mysql-installer-community-8.0.20.0"
Then remove/uninstall the SQL Server and remove all configurations
Manually delete the SQL Server folder from "C:\Program Files\MySQL\MySQL Server 8.0."
Start your mysql installer again and install the SQL Server again
You can check from the window's services that the MySqL Server has started.
Hope it helps someone.
Check for missing folders that are required by the server, in my case it was UPLOADS folder in programData which was deleted by empty folder cleaner utility that I used earlier.
How did I find out:
run the server config file my.ini(in my case it was in programData) as the defaults-file param for mysqld (don't forget to use --console option to view error log on screen)
'mysqld --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console'
Error:
mysqld: Can't read dir of 'C:\ProgramData\MySQL\MySQL Server 8.0\Uploads\' (OS errno 2 - No such file or directory)
Solution:
Once I manually created the Uploads folder the server started successfully.
In my case, I'm MySQL5.6, install by workbrench install tools in Win10 pro.
there are two configuration file need to modify,
only edit the line: datadir=E:\MySQL
stop MySQL56 service using services.msc
edit my.ini under C:\ProgramData\MySQL\MySQL Server 5.6
edit my-default.ini under C:\Program Files\MySQL\MySQL Server 5.6
copy C:\ProgramData\MySQL\MySQL Server 5.6*.* to E:\MySQL
start MySQL56 service using services.msc
test: create database 'testdb';
It's successed if found testdb folder exist in E:\MySQL.
Tried the below
Workaround for the 10.10 Preview 5 bug: Rename the file “envvars”
located in /Applications/MAMP/Library/bin into “_envvars”
Patched by renaming
Quit MAMP and restarted still am getting the following error
When i got to http://localhost/ I get a page that says
It works!
But when i go to the folders that used to work before i get an error
Not Found
The requested URL /prayag/ was not found on this server.
When i try to visit MySQL also i get the following error
Not Found
The requested URL /phpmyadmin/ was not found on this server.
Have you tried to kill all sql service and restart:
Steps:
Quit MAMP
Open the terminal and type: killall -9 mysqld
Restart MAMP
Unless you have removed or otherwise disabled the native Apache server on OSX, it will start automatically and your Servers associated with your MAMP installation won't start.
To see if this is the problem, try opening a Terminal and issue the command:
sudo apachectl stop
Then try starting your MAMP servers again.
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.
I'm getting the following errors when I launch XAMPP.
12:35:23 [main] Initializing Control Panel
12:35:23 [main] Windows Version: 64-bit
12:35:23 [main] XAMPP Version: 1.8.1
12:35:23 [main] Control Panel Version: 3.1.0 3.1.0 [ Compiled: September 20th 2012 ]
12:35:23 [main] Running with Administrator rights - good!
12:35:23 [main] XAMPP Installation Directory: "c:\xampp\"
12:35:23 [main] Checking for prerequisites
12:35:23 [main] All prerequisites found
12:35:23 [main] Initializing Modules
12:35:23 [Apache] XAMPP Apache Service is already running on port 80
12:35:23 [Apache] XAMPP Apache Service is already running on port 443
12:35:23 [mysql] MySQL Service detected with wrong path
12:35:23 [mysql] Change XAMPP MySQL settings or
12:35:23 [mysql] Uninstall/disable the other service manually first
12:35:23 [mysql] 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
12:35:23 [mysql] Expected Path: c:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysql
12:35:23 [mysql] Problem detected!
12:35:23 [mysql] Port 3306 in use by "mysqld.exe"!
12:35:23 [mysql] MySQL WILL NOT start without the configured ports free!
12:35:23 [mysql] You need to uninstall/disable/reconfigure the blocking application
12:35:23 [mysql] or reconfigure MySQL to listen on a different port
12:35:23 [main] Starting Check-Timer
12:35:23 [main] Control Panel Ready
I wasn't able to find a proper solution on google, so I'm kinda' hoping someone could help me out with this.
Oh and, XAMPP is running properly. Apache and the MySQL service are both running ..
Go to cmd and run it with Administrator mode.
Uninstall mysql service through command prompt using the following command.
sc delete mysql
restart XAMPP
To delete existing service is not good solution for me, because on port 3306 run MySQL, which need other service. But it is possible to run two MySQL services at one time (one with other name and port). I found the solution here: http://emjaywebdesigns.com/xampp-and-multiple-instances-of-mysql-on-windows/
Here is my modified setting:
Edit your “my.ini” file in c:\xampp\mysql\bin\
Change all default 3306 port entries to a new value 3308
edit your “php.ini” in c:\xampp\php and replace 3306 by 3308
Create the service entry - in Windows command line type
sc.exe create "mysqlweb" binPath= "C:\xampp\mysql\bin\mysqld.exe
--defaults-file=c:\xampp\mysql\bin\my.ini mysqlweb"
Open Windows Services and set Startup Type: Automatic, Start the service
This is how I solved similar problem:
Launch XAMPP Control Panel.
Uninstall the MySQL service: click 'green check' button beside MySQL, under Service column. The 'green check' button will change into 'red cross' button.
Exit XAMPP, and relaunch it again.
Click Start.
I hope it can help solve your problem too.
Firstly enter cmd.
Then write:
sc delete MySQL
After that restart your computer. When restarting your computer and opening your xampp, you can see cross symbol on the MySQL. Click the cross symbol and click the start. That's all.
Set XAMPP controlpanel to run under Administrator priviledges.
In Win 7
1. First make sure XAMPP control panel is not running
2. SHIFT+right click on XAMPP Control Panel
3. Click on properties
4. In properties select tab 'Compatibility'
5. On bottom of the tab under 'Privilege level' check the box "Run this program as an administrator"
6. Click OK
this worked for me
Ok so i found out the problem :)
ctrl+alt+delete to start task manager, once you get to task manager go to services. find MySQL and right click on it. Then click stop process. That worked for me and i hope it works for you :D
its because you probaly installed wamp server and uninstall it but wampmysql.exe still running and using the default mysql port
go to msconfig
under services tab uncheck wampmysqld to deactivate it
reboot the computer should work
Ok it's very easy actually to solve this...most of you who are presented with this problem probably don't even realize you don't have the full software yet installed :)
I tried looking online with little success except some1 mentioned you need to look for those services running already. Forexample problem with filezilla you look in task manager for filezilla and you stop the process then you click the X in the xampp control pannel to install filezilla and then click run and it should start the service normally showing you a green lite with a check mark.
Same goes for mysql issues.
As for the apache problem, it usualy is a problem with the port being overtaken by skype or some other program, but you can find info how to solve that on the net easily :)
about this specific issue:
12:35:23 [mysql] 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
12:35:23 [mysql] Expected Path: c:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysql
notice that .exe is missing from 1st row at the end of mysqld.
To fix this, start regedit.exe and change
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\mysql ImagePath
by adding the .exe extension.
Restart xampp control panel and this error should not show up.
This is how I solved mine, using mircea answer above.
From the error above, copy the mentioned Expected Path.
Start regedit.exe, go to HKEY_LOCAL_MACHINE then SYSTEM then CurrentControlSet then services then MySQL. Click ImagePath, Edit, Modify. Paste the Expected path copied from the above into the Value data field, Press OK, close regedit. Restart Xampp.
That is how it worked for me, for I'm having MSSQL server installed and running and didn't want to do away with it.
In my case this issue caused because my local machine used to the one MySQL service installed earlier at 3006 port.
Thus I modified both my.ini (C:\xampp\mysql\bin\my.ini) and php.ini (C:\xampp\php\php.ini) files replaced port 3006 to 3008
After that I've created a new service running the command described above by Tommer:
sc.exe create "mysqlweb" binPath= "C:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysqlweb"
hello i have had same problem an i did the steps with tommer and the problem solved thank you
note :
you don't have to go to that like just do this ;
1)-- Edit your “my.ini” file in c:\xampp\mysql\bin\ Change all default 3306 port entries to a new value 3308
2)--edit your “php.ini” in c:\xampp\php and replace 3306 by 3308
3)--Create the service entry - in Windows command line type
sc.exe create "mysqlweb" binPath= "C:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysqlweb"
4)--Open Windows Services and set Startup Type: Automatic, Start the service