mysqld won't start on fresh install on MacOS - mysql

I'm trying to get MySQL up and running for some analysis on my Mac.
MySQL version: 8.0.19
MacOS version: 10.14.6
The timeline is:
I installed MySQL successfully from https://dev.mysql.com/downloads/mysql/
It worked fine, I was able to create simple tables, etc. But when I tried to create my real schema, I realized that the default record size of 8k bytes wasn't enough; I had to increase it to the maximum, 65k bytes https://dev.mysql.com/doc/refman/8.0/en/column-count-limit.html#row-size-limits.
After reading the documentation, I learned that the row size can only be set when the database is initialized for the first time. So I wanted to start fresh, ensuring that when I first initialized the DB, the appropriate parameters were set.
So, I uninstalled MySQL using the widget in my Mac's Command Center. I rebooted, ensured no MySQL processes were running, then ran find -iname 'mysql' 2>/dev/null in the terminal, and found nothing. All traces, so far as I can tell, of MySQL were gone.
I downloaded the macOS 10.15 (x86, 64-bit), DMG Archive package again from https://dev.mysql.com/downloads/mysql/, installed it, used all the default settings in the installer, and then opened the MySQL widget from the Command Center again.
Here's where I configured the parameters. There's a place where I can put in a configuration file. So, following the advice in this How to workaround the row size limit of 66 KBytes, I created mysql.cnf in my home directory, put only these three lines in it, and put the filename in the box (checking the tickbox next to it):
innodb_page_size=64k
innodb_log_buffer_size=32M
innodb_buffer_pool_size=512M
I hit "apply". Then I went back to the other tab, hit "initialize database". No errors, seemed to work fine. Then I hit "start MySQL". The lights went briefly green, then red again. Multiple attempts, reboots, etc, don't seem to have any effect. In short, MySQL was trying to start up, but failing.
I also tried removing the mysql.cnf file, hitting "apply" and "initialize" again, and the problem is the same. I don't understand why this all worked before I uninstalled, but won't now.
I checked /var/log/system.log, and all I see is a bunch of lines noting the failure of MySQL to start:
but nowhere is the error from the application itself shown.
I did some Googling and SO'ing and looked in /usr/local/mysql/data/ as root, and I can see files that are in binary. But i do not know how to read these binary logs.
My questions:
How can I tell what error is preventing MySQL from starting?
How can I diagnose this issue? Is there a tool to read these binary files?
Does anyone know why MySQL would fail to start after a full wipe and re-install, though it was working in the first instance?

I experienced MySQL's failing to start from the System Preferences on Mac. It would turn green and red again. I also wiped and reinstalled a few times and it still wouldn't start.
In my case, I realized it was because I had AMPPS stack installed and its MySQL running at the same time. After turning off the MySQL in the AMPPS stack, I was able to start MySQL from the System Preferences successfully. Not sure if you had another software stack running that would cause the problem.

Related

MAMP MySQL won't start (Windows 10)

I see from reading around this is a very common problem and there are 2 recommended main solutions:
clear the temp files; and
check if another instance of MySQL is running.
Solution 1 - Clear files
I have cleared ib_logfile0, ib_logfil1 and iddata1. When I restart MAMP, it recreates these files but the server does not start.
Solution 2 - Close other instances of MySWL
I am unable to find a way to check if MySQL is already running else where. Reading around (inc MAMP help site), I should use Window task manager to search for "MySQLd" and close any instances that are running, however Win10 seems to have delete the search function from the task manager. A look through the processes did not show any though:
screen shot of windows task manager
Next I have seen people adding "innodb_force_recovery = 1" to my.cnf file. I searched for my.cnf but couldn't find it. Instead I tried adding the line to C:\MAMP\conf\mysql\my.ini and I also tried adding "innodb_force_recovery = 2". Neither worked.
I tried changing the port number that MySQL uses to 3307, that didnt work either.
Finally, I uninstalled and re-installed MAMP - didn't work.
The MySQL error log reads:
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
[Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
[Note] C:\MAMP\bin\mysql\bin\mysqld.exe (mysqld 5.7.24-log) starting as process 9044 ...
I think it would be useful if there is a way to check for instances of MySQL running via the command line, and then if they is one, how to close it from the command line.
Following steps fixed my issue
1. Stop your MAMP Server.
2. Find the db folder for mysql. In my case: C:\MAMP\db\mysql
3. Rename the mysql-bin.index file to mysql-bin_old.index
4. Start your MAMP Server
This question has been answered here:
MySQL Server on MAMP-Windows Will Not Start
The fix posted by this user apparently comes from MAMP support. My problem was identical to yours and it worked for me. The issue related to binary logging, which can be disabled in a configuration file.
Good luck.
This is what worked for me :
Click on Start Servers in MAMP
Manually click on mysql.exe in MAMP installation folder
C:\MAMP\bin\mysql\bin\mysql.exe

MySQL - Restarted laptop and all databases are gone?

I use MySQL 5.6 on a Windows 7 Laptop. I restarted my laptop, came back on and for some reason it wasn't started. So I went to command prompt and restarted it (as it's not a service) only to find out my MySQL user got deleted?
Basically it's like my old MySQL user is just gone, 1. All my databases are gone which is weeks of work (as well as my database backups) 2. My root user doesn't have a password anymore?
Anyone know what's going on? Can I get my databases back? It wasn't a version upgrade or a laptop upgrade. I simply restarted my laptop as it was lagging a bit.
Anyone any ideas? Cheers.
Referred to your comments:
Yes you have the folder but it is hidden.
Type win+R or click run from start menu. And type : c:\programdata\ type enter and open mysql\data folder.
Probably you will find your data in this path.
EDIT :
Copy the Data folder safe place first. And then remove all mysql and all related files. Perform clean install. And replace your existing data folder to new one. That's all.

homebrew: MySQL not starting, Can't update PID file

I am a new Mac user and trying to set up the development environment with Apache, PHP and MySQL. Initially, after a lot of installs and reinstalls i succeeded in installing MySQL (Apache and PHP came bundled with Mac) but now again mysql refuses to start up and gives the error, The server quit without updating PID file (/usr/local/var/mysql/Nikhils-MacBook-Pro.local.pid).
I have literally gone through entire SO questions regarding this problem but have not found a way to fix this and i mean i have done everything to start this but in vain. I have created the PID file too but it disappears in moments, i did a cleanup and reinstall using this SO Question but it has failed YET again. Please, i need to get my server started, i am really losing on to serious work and time.
Is there any other miraculous way to fix this unattainable feat? Also, if anyone asks what is the error in the log files, please don't as there is no log being registered as the server hasn't started yet.
I’ve got a similar problem with MySQL on a Mac (Mac Os X Could not startup MySQL Server. Reason: 255 and “ERROR! The server quit without updating PID file”) and after a long trial and error process, finally in order to restore the file permissions, I’ve just do that:
launch the Disk Utilities.app
choose my drive on the left panel
click on the “Repair disk permissions” button
This did the trick for me. Hoping this can help someone else.
brew install mysql on mac os
These instructions helped me. There was a my.cnf in /usr/local/opt/mysql/ which seems to have been the problem for me. YMMV.

MySQL keeps stopping

Came into work this morning to find one of our servers had mysql not running. Checking logs, I found a empty log file for today. It has been created around 530am, the Rackspace server panel says the server was "Last Updated:" around the same time. I rebooted the box to try and see if mysql was just not starting on boot, and it start.. I also ran "sudo update-rc.d mysql defaults" and found it was already in the list. One of the other developers in the office told me this was the 3 time in the last 2 week that the box has turned off mysql without errors or warnings. New Relic shows the server has not gotten over 60% of memory, so I have no idea why it keeps turning off.. Any ideas?
I have removed sudo and changed root passwords just incase someone in the office was turning it of unintentionally or something stupid like that.

SQL Server installation errors

I've been trying to install SQL Server 2008 R2 with tools.
I've downloaded thisn version and it just won't work!
I've had some problems installing Visual Studio SP1 due to silverlight4 being already installed, so I figured i needed to uninstall everything that had something to do with sql server, so I did.
Still the errors show up.
These 2 errors show up at the beginning of the installation during "Setup support files".
(I can't post more than 2 url's yet, so Ive put all the screenshots in 1 image, sorry)
Here
The first error is the top left one, and retry fails, and when I hit cancel a few secs later the second error pops up and the installation terminates.
My OS is W7 x64 with all updates installed.
I don't really know how to go on actually. I've searched for hours yesterday without any results.
Anybody got a clue? Before I reinstall every .net-related programs.
Thanks in advance!
Edit:
So far I've tried:
I checked if the first file shown in error 1 is actually there, and it is.
Tried to run the setup explicitly as administrator
I checked if the second file/folder was present, and it was not. So I manually created the folder and file, which then causes the
first error to say the same, but then it says can't create
\SqlSupport_Cpu64_1_ComponentUpdate_1.log, then I tried
to create an empty file with that name and extention. This makes the installer
append the filename with "_1". If I create that file too, it just
appends with a higher count.
Uninstalled every sql server related program (e.g sql server compact)
Reset all the permissions on the e: disk and formatted it.
I found the cause of the problem. Recently I'd set my default program files folder to my hdd, because my C: is a 60 GB SSD. The key is located in the register at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion. The keys "ProgramFilesDir" and "ProgramFilesDir (x86)" are the ones that need to be default ("C:\Program Files" and "C:\Program Files (x86)") in order for it to work.