MySQL80 Service on local computer started and the stopped. How to solve? - mysql

I'm receiving this error of MYSQL80 service on local computer started and stopped. Some services stop automatically if they are not in use by other services or programs. when I try to start my MySQL server from the services.msc
I already run mysqld --install and mysqld --initialize. Already tried to change the properties of the service to local system account. I checked my.ini file, it is in Program Data folder, the Uploads folder exists as well. I also checked the .err file but nothing is helpful there, the last line is something like 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. that I don't really know what it means and google didn't help.
I don't know what else to try, I tried pretty much everything that I found.
This is my path to executable, do you think this should point to my.ini file? If so, how do I change that?
Also, there is another MySQL service on the list which I can start, but it's empty, my database is on the MySQL80 server (the one that I cannot start):
Any idea?

I am assuming that the password you enter is valid and still it's showing a login error.
I had the same issue just to allow the table to CSV export. I made some changes in my.ini and the service mysql80 never started.. after searching everywhere I came to the conclusion that we need to uninstall the MySQL server (Just server) and reinstall it.
Don't worry your databases will be safe just uninstall MySQL server "Control Panel\All Control Panel Items\Programs and Features" and reinstall MySQL server. MySQL installer-> add->mysql server 8.X.X, and try login again.
Hope this help just worked like magic for me.

If using version 8 and you edit the my.ini I found that Notepad is putting 3 hex characters at the beginning of the my.ini file. EF BB BF. Deleting the 3 characters from the beginning of the file in a hex editor fixes the problem.
In version 8 they are accidentally putting Unicode characters in the ini file. This is causing Notepad to save the file with Byte order mark characters.
The following line in the file is the culprit "The line # range from 1 to 2^32 − 1. “Unique” means that each ID must be different." has 3 Unicode characters. This is causing notepad to append the byte order mark to the text file.
The other solution is to replace the my.ini file if you have a backup.

Stop the service mysql and start the services mysql80.
That's what I did and worked.

Related

Cannot find mysql bin file in macos

I am having a lot of problems with mysql on macos 10.14. It started with trying to reset my password. Back when I collaborated with someone in 2018 my collaborator used mysql but I did not know how to work it. I have a feeling that the password I used for mysql is not the typical password I used because my attempts to log in failed. watching this video I was told at 9:12 that the password would be set on installation but that turned out to be false. I was never asked for a password upon downloading but perhaps that is because I had part of mysql already downloaded on my computer but I did not have the workbench installed. All of my attempts to reset the password failed. So I then tried deleting mysql and redownloading. Now I am not able not to start the mysql server from mac's system preferences. But that's not my largest problem. I still cannot reset the password and hence even use the app. Following official mysql instructions I cannot reset the password because it requires the location of a pid file. It says
Stop the MySQL server if it is running. Locate the .pid file that contains the server's process ID. The exact location and name of this file depend on your distribution, host name, and configuration. Common locations are /var/lib/mysql/, /var/run/mysqld/, and /usr/local/mysql/data/.
In the folder for mysql located in /usr/local/var/mysql there is no pid file. A lot of the tutorials I've seen recommend using terminal but I cannot use terminal for mysql because I get the mysql command not found error. Ok, so to fix that problem trying this tutorial here it says:
If you’re installing MySQL using the official installer, then your MySQL bin/ folder should be located on /usr/local/bin/mysql
So now I need to find the mysql bin file but when I write ls in the /usr/local/bin folder, mysql does not come up. All of the file beginning near 'my' are
multinit
murge
nasm
So I'm stuck. I find it simply incredible that such a simple thing as resetting a password is so difficult.
Let’s say we installed MySQL version is 8.0 on our Windows OS. The bin directory is present at the following location −
C:\Program Files\MySQL\MySQL Server 8.0\bin

Can you tell me why MySQL 8 is not using my.cnf on Mac Mojave

I am trying to setup the MySQL i have installed on my Mac. Mac is 10.14.6 Mojave. MySQL is 8.0.21.
I have created a my.cnf file in the main mysql directory, which is
/usr/local/mysql
I have set the path to the config file using the system preferences pane for MySQL (select 'Configuration File', Press Select button ad navigate to/select file.
Restarted server (many times!) and MySQL is just not 'seeing' or using the my.cnf.
I have put many 'whacky' test settings in the file to see if it is being used; port changed to 3308 (MySQL Workbench still connects and says it is 3306), changed location of general and error logs (no sign of them in new location) etc etc.
Can anybody suggest what I am doing wrong and why my.cnf is not being used?
Many thanks
Mark
Thanks to the guys that responded. nbk put me on the right track, but in this instance it was not due to the cnf file being in the wrong place as so many others have found. It was due to permissions.
In fact the permissions being TOO RELAXED! Not that MySQL could not read the file but that it detected that EVERYONE could read the file and so it ignored it.
That to me is bonkers, and if you must be so draconian about reading a text file then at least put a message in the **** log file!
Anyway, this was the answer as found in the post linked above by nbk and repeated here. The original poster of the answer was JayRizzo, so thanks to him as well for his very complete response to the previous question that put me on the right track.
Location of my.cnf file on macOS
Important Notes:
On Unix platforms, MySQL ignores configuration files that are world-writable.
This is intentional as a security measure.
In other words, if you have the wrong permissions set on your config file the will NOT load.
Example of initial setup permission of one of the config files:
RIZZOMBP$ ls -lah /etc/my.cnf
-rw-r--r-- 1 myusername wheel 0B Feb 25 20:40 /etc/my.cnf
Cheers
Mark

MySQL Workbench Unable to Retrieve Disk Space in Data Dir, Server Stopped

I had mySQL workbench working fine a few weeks ago. Now, any time I log in, I get no connection. Upon inspecting Sever Status, it is showing Stopped. Also, under the Server Directories, it says Unable to Retrieve next to Disk Space in Data Dir.
I also noticed that the configuration file was wrong, or outdated? The Configuration File originally read:
C:\ProgramData\MySQL\MySQL Server 5.5\my.ini
But I looked and there was no MySQL Server 5.5 file in my directory. I do have a MySQL Server 8.0 folder, so I changed the Configuration File to:
C:\ProgramData\MySQL\MySQL Server 8.0\my.ini
However, this fails to solve the problem. I've also attempted to run Services from the Start Menu, right click on MYSQL80, and choose start - and it says the service has Started then stopped.
I'm not even sure this missing or mis-directed file is the issue, or whether it's the Unable to Retrieve Disk error (or both are causing the server to fail). I recently changed my login password for my computer - but I doubt that is related to the login credentials for MySQL, right? (I see MYSQL80 properties has password for 'log on' option, but I have no idea what this password even is, or how to change it).
I've also read about this problem online and cannot seem to find an answer that solves the issue. I've tried running MySQL Workbench as an admin too, and that doesn't work either.
Can anyone point me in the right direction? Is there a way to get the server up and running again without a bunch of complicated command line? I appear to have mysqld.exe in the bin file in MySQL 8.0
Thanks all in advance!
In MySql Workbench Server -> Startup/ShutDown -> Start Server.
This Worked for me.
When the my.ini file is messed up I think the best solution is a total uninstall/delete and manual install. Before you do any of the following make sure you go to your current data dir and save your database folders. Then dlete all of your current MySQL related directories and uninstall MySQL and MySQL workbench.
I had this problem when I installed MySQL 8.0.15 with the community installer. The my.ini file that came with the installer did not work correctly after it had been edited. I did a full manual install by downloading that zip folder. I was able to create my own my.ini file containing only the parameters that I was concerned about and it worked.
download zip file from MySQL website
unpack the folder into C:\program files\MySQL\MySQL8.0
within the MySQL8.0 folder that you unpacked the zip folder into, create a text file and save it as my.ini
include the parameters in that my.ini file that you are concerned about. so something like this(just ensure that there is already a folder created for the datadir or else initialization won't work):
[mysqld]
basedire=C:\program files\MySQL\MySQL8.0
datadir=D:\MySQL\Data
....continue with whatever parameters you want to include
initialize the data directory by running these two commands in the command prompt:
cd C:\program files\MySQL\MySQL8.0\bin
mysqld --default-file=C:\program files\MySQL\MySQL8.0\my.ini --initialize
install the MySQL server as a service by running these two commands:
cd C:\program files\MySQL\MySQL8.0\bin
mysqld --install --default-file=C:\program files\MySQL\MySQL8.0\my.ini
finally, start the server for the first time by running these two commands:
cd C:\program files\MySQL\MySQL8.0\bin
mysqld --console

MySQL binary log location Windows 2008 Server

I'm running a Windows 2008 Server with IIS, PHP and MySQL. MySQL is installed as a service. There's software on the server that uses a database that I need good backups of, including transaction logging. I've turned on Binary Logging via setting log-bin= and expire_logs_days= in the my.ini file. This saves those logs in the MySQL data folder on that drive. If I lose the drive, I lose my logs and they've done me no good as a backup.
I've found all kinds of advice for relocating these logs on a Linux box, but trying to use the same idea of including a path in the log-bin statement is not working. I've tried "flipping" the slashes, adding quotes and the common other attempts when "translating" Linux to Windows.
I created a mapped drive to the external location to make this easier, and I've tried using \server\folder path statements as well as z:\ path statements.
Any help would be greatly appreciated.
If you made your changes in the [mysqld] section in the my.ini file then you should be good. The correct path naming convention, should look something like this log-bin="C:/yourfilepathname/logs". Since you are still experiencing issues, Please check to make sure that mysql has permission to write to the directory that you are specify the logs files to be written to.
Another way you can check if this is the issue, go to your .err log file when you try to stop and start mysql server it will tell you something along the lines of not having permission to write to that directory.
Also, I would note that log bin files in it of themselves are not a backup. You need to be taking mysqldumps or snapshots of the entire directory from your server, preferably from a slave of your master production server.
You are missing a trailing slash.
Here is what's in my my.ini (I'm using MariaDB 10.1, but I believe this will work for you also):
[mysqld]
datadir=D:/mysql-data
log-bin=E:/mysql-bin/
When I left out the trailing slash in the log-bin setting, I also got the same error in logs, and the service failed to start. After adding the slash, no errors, and the service started successfully.
I now see files getting created in E:\mysql-bin, such as .index, .000001.
make sure you are ending with filename. see below.
log-bin=C:/Program Files/MySQL/MySQL Server 5.6/data/bin.log
Actually it's due to using the normal windows backslashes. Instead of z:\ use z:/ (forward slash). Also if you don't end with a forward slash then it will use the last part as the file name. Exp:
z:/bin-logs/ (this will have files named .index and .000001)
z:/bin-logs/log (this will have files named log.index and log.000001)

MySQL Master-Slave replication on Windows, when put server-id=1 on master it's not starting

I am trying to get Master to Slave replication on my MySQL server, but after put in server-id=1 in the my.conf and stop the mysql server and then start it again from Services in windows it's getting error and could not start.
Problem is that i can not find a real error message, the only one i get is from windows that could not start the service.
Do anyone have any ideas?
If you have trouble starting the MySQL service, check its error log. On Windows, it's probably located in C:\Program Files\MySQL\MySQL Server x.y.z\data\computername.err (where computername is the name of your Windows server).
A couple of ideas: try spelling the config variable "server_id" with an underscore instead of a dash. They are supposed to be interchangeable, but I have seen cases where they aren't for specific variables.
Search the config file to see if you have another line declaring a different server-id.
Did you make any other changes to the config file at the same time? If so, it could be that the server-id change is fine, but another change resulted in an error. Undo those changes and make them one at a time, restarting the MySQL service each time.