mysqld unknown option '--ndbcluster' - mysql

I cannot get MySQL to start. It was running for months on my machine, then my machine crashed and it will not restart. In the log file I get the following error:
[ERROR] /usr/local/mysql/bin/mysqld: unknown option '--ndbcluster'
From what I have read, '--ndbcluster' is an option for running your db in clustered mode. I am not running in clustered mode, and I have not attempted to do so.
I am running MySQL 5.6.15 on OS X 10.8.3.
I deleted the MySQL install directory: /usr/local/mysql-5.6.15-osx10.7-x86_64, then reinstalled and I get the same error.
Is there some ENV variable that is causing nbcluster to be set?
Update: I installed MySQL Admin during the time between I started MySQL and the machine reset, as well as the MySQL Java libs.
Update: Based on this post there is a my.cnf somewhere (/etc/my.cnf on my Mac) that has those options. The my.cnf file on my machine is full of options about running in cluster mode including the option ndbcluster.

Removing /etc/my.conf and re-installing worked.
After I re-installed MySQL /etc/my.conf was not set.

Related

MacOS Can't start MySQL Server

I have MacOS Sierra. I have installed MySQL Server which has been working, however, after a reboot of the Mac Book, I cannot start the MySQL Server.
I have tried changing the port from 3306 to 3307 in the my.cnf file.
Question
I would appreciate any help on how to start the MySQL Server, and also have it so it starts automatically on MacOS Boot up.
(I am new to Mac, so apologies if this is a basic question).
UPDATE
Looking for error logs, I can't find anything with todays (2/2/2017) timestamp.
Nothing in the data dir:
No files with "mysql" have been modified since I've tried to start the MySQL Server (2/2/2017 after 09:00).
I suggest using Terminal commands.
Start MySQL
sudo /usr/local/mysql/support-files/mysql.server start
Stop MySQL
sudo /usr/local/mysql/support-files/mysql.server stop
Restart MySQL
sudo /usr/local/mysql/support-files/mysql.server restart
In my case, I had inadvertently transferred ownership of entire /usr/local directory to myself, which resulted in snatching-away of write permission of /usr/local/mysql-5.7.20-macos10.12-x86_64/data directory from the daemon user called "_mysql".
Restoring the ownership fixed the issue.
After a discussion with Richard, the following solves the issue:
my.cnf:
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
port = 3306
socket = /tmp/mysql.sock
datadir = /usr/local/mysql-5.7.17-macos10.12-x86_64/data
tmpdir = /tmp
Essentially, although we'd added the relevant stanza's to the my.cnf file, we'd still missed the section heading. Adding the [mysqld] section allowed mysql to start.
After installing Mysql 8.0.12 on MacOS High Sierra, Mysql server would not start up. I tried several suggestions like removing mysql and reinstalling it, rebooting the computer and changing file permissions, all to no avail. I finally got it to work by removing /etc/my.cnf.
In my case, ownership of the msyql directory had somehow changed to admin:admin. I use ares suggestion to run mysqld from the terminal:
sudo /usr/local/mysql/support-files/mysql.server start
Which showed a permissions error writing to a msyql file.
I fixed with this command:
sudo chown -R _mysql:wheel /usr/local/mysql/data
from this post:
What user should own /usr/local/mysql on Mac?
In my case, First time, after installing Mysql, Mac needs a restart.
So restarting Mac, after installation, fixed the issue for me.
MacOS doesn't come with a my.cnf file. Default settings will suffice the needs for basic usage. Once we need to override them, it makes sense to have a custom configurations.
This solution works for me.
You have to open the activity monitor up and search for mysqld service. Once selected, just click the delete button located in the up left part and you will see the memory goes down. After that, you can verify your mysql server status from System Preferences and the service is up.
With this solution you don't have to restart your machine and get to work fast.
My problem was that due to an incorrect restart of my machine, a database was corrupted. According to their docs doing a forced InnoDB Recovery did the trick:
/etc/my.cnf
innodb_force_recovery = 2
My problem was that I installed MySQL a while ago with Homebrew (forgot I did) and then went the more manual route, so I think the two installs were fighting each other. I wiped my Mac of both with the help of this walkthrough: https://gist.github.com/vitorbritto/0555879fe4414d18569d
Note: Where it says to use subl - that's Sublime, use whatever editor you like.
I was able to get things to work with a fresh install after that.
I had this same issue on Monterey. Make sure you're selecting the correct download according to your processor architecture.
I ran into same problem with following .err log.
MacOS: Catalina 10.15.7.
MySQL version: 5.7.19.
2021-08-19T02:17:26.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
2021-08-19T02:17:27.303813Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-08-19T02:17:27.318280Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2021-08-19T02:17:27.335112Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.19) starting as process 2828 ...
2021-08-19T02:17:27.421394Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2021-08-19T02:17:27.428986Z 0 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2021-08-19T02:17:27.429541Z 0 [ERROR] Aborting
2021-08-19T02:17:27.429688Z 0 [Note] Binlog end
2021-08-19T02:17:27.432786Z 0 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
And I found adding --user=root to Ares's answer will start mysql server successfully.
sudo /usr/local/mysql/support-files/mysql.server start --user=root
Ref.: MySQL Server Command User Options

MySQL not working after Kubuntu upgrade

I have just upgraded to Kubuntu 15.04 and MySQL is no longer working properly. The error is:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)
I have checked and there is no mysqld.sock file at that location (and no directory 'var/run/mysqld'). I've tried creating a directory at 'var/run/mysqld' and using chmod to make it writable by all, then restarting MySQL using 'sudo service mysql restart', but this doesn't solve the problem.
MySQL seems to be running (it's coming up as loaded & active when I run 'sudo service mysql status'). There's nothing in the MySQL error log.
I can't find any mysqld.sock file at all (did a search across the whole file system).
Any solutions before I give up and purge/reinstall mysql would be gratefully appreciated!
EDIT to add:
The MySQL process itself isn't in the process list. No errors are thrown when I start/restart MySQL using 'sudo service mysql', and /var/log/mysql/error.log is empty.
I managed to get it working by changing the permissions on /var/lib/mysql and then running "mysqld" at the command line
So presumably some sort of permissions screw-up that happened as part of the Kubuntu upgrade.

Mysql not restarting in ubuntu

I am trying to connect my java program in the host OS with the mysql database in the ubuntu VM. I have created the necessary tables in the database and changed the bind-address in the my.cnf file to that of the host OS address. While I am trying to restart mysql, I am getting:
mysql stop/waiting
start: Job failed to start.
Then when I am trying to access mysql, I am getting the following error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2)
Please help me with the solution.
Simply follow below step to start MySQL server.
Try to restart MySQL server from terminal. (In RHEL that is /etc/init.d/mysqld restart)
Still same issue then follow below step.
Rename mysql.sock file with another name e.g. mysl.sock_old in following directory.
/var/run/mysqld/
Now restart your MySQL server.
I have the same issue with mysql on Ubuntu14.04.
I fixed the issue by commenting configuration in /etc/mysql/my.cnf file.
innodb_buffer_pool_size=10G
innodb_log_file_size=54M
After commenting mysql service runs well..
Note :- If you comment these configuration then default configuration will take care the size of buffer pool and log file.
So not any issue .
But if you want to mention it manually , then provide 80% of your physical memory to buffer pool size.
and 25% of buffer pool size to log file.

Homebrew "brew install mysql" giving "...Error while setting value '127.0.0.1' to 'server_id'"

I recently upgraded my system to OS X Yosemite and started encountering some issues to connect locally to my Database via MySQL Workbench.
It was mainly classic ones about the PID files and socket, that I managed to find solutions for looking over the web. However one was remaining : "Can't connect to MySQL server on '127.0.0.1' (61) (2003)", and none of the solutions I found on the MySQL website, stackoverflow and other forums were working.
I therefore decided to reinstall MySQL using the dmg file (version for OS X 10.9 though, no version yet available for 10.10). It did not work.
That's why I eventually uninstalled every little piece of mysql that I could and reinstalled a clean version using homebrew. The steps I followed are those ones.
However, this did not work either and here is the error message I got :
$ brew postinstall mysql
==> /usr/local/Cellar/mysql/5.6.21/bin/mysql_install_db --verbose --user=Antoine
Installing MySQL system tables...Unknown suffix '.' used for variable 'server_id' (value '127.0.0.1')
2014-10-20 02:35:05 0 [ERROR] /usr/local/Cellar/mysql/5.6.21/bin/mysqld: Error while setting value '127.0.0.1' to 'server_id'
2014-10-20 02:35:05 0 [ERROR] Aborting
2014-10-20 02:35:05 0 [Note] Binlog end
It makes now a little more sense that MySQL server was not able to connect to 127.0.0.1, but I must say that I'm lost and do not really know where to look anymore. I can't find anything on this error message. I had a look to the mysqld file, but it was useless.
Do you think the issue is linked to OS X Yosemite? Any clue of what I could do from here?
I had the same problem, here the solution:
http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-10-yosemite/
You only have to start again MySql:
sudo /usr/local/mysql/support-files/mysql.server start
I eventually managed to fix the issue by, in this order :
1/ Upgrading to xcode command line tools 6.1
2/ Following those steps to remove completely MySQL
3/ Restarting my computer
4/ Installing MySQL back with the OS X 10.9 package (dmg file available on mysql website)
5/ Copying the my-default.cnf file to the etc folder : sudo cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
6/ Starting the server the first time with this command in terminal : sudo /usr/local/mysql/support-files/mysql.server start
No PID issue, no socket issue, no connection issue to localhost. Everything's fine now.

MySQL won't start on XAMPP server

I have a problem with my XAMPP server. I can start Apache, FileZilla, and every thing else without problems, but when I try to start MySQL, it just says
Attempting to start MySQL service...
and it stays like that forever, like if it was frozen or something.
Any ideas how to fix it?
I fetch the problem to start xampp services "mysqld.exe: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files"
I delete all area_log files form xampp\mysql\data
after that I restart XAMPP than it works.
Thanks
Check the log files for MySQL. You will find them in this directory:
C:\xampp\mysql\data (assuming standard install location of xampp)
Also check if no other program or service uses the default MySql port.
You can do this by using this command:
netstat -an | findstr "3306"
If anything shows up the default mysql port is in use.
In Windows, you should go: Start > Run > services.msc > Apache 2.4 > Properties > Start Mode > Automatic > Apply > Start > OK > [Same as MySQL]
I was not able to start Mysql on xampp.
Error message was:-
Aria recovery failed. Please run aria_chk -r on all Aria tables and
delete all aria_log.######## files. Plugin 'Aria' init function
returned error. Plugin 'Aria' registration as a STORAGE ENGINE failed.
Plugin 'FEEDBACK' is disabled. Aria engine is not enabled or did not
start. The Aria engine must be enabled to continue as mysqld was
configured with --with-aria-tmp-tables. Aborting.
Just to go xampp/mysql/data and delete or remove the file related to aria_log and restart your xampp server.
Worked fine for me.
Resolve the issue stopping the mysql process in the activity monitor and then restarting the mysql server from within the xampp UI.
Go to the error log and check. For me I got this error message:
InnoDB: Error: could not open single-table tablespace file .\mysql\innodb_index_stats.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
So what I did was I went to the mysql folder and deleted the data1idb file. After that it worked fine. The problem started when I installed Drupal.
Perform
which mysql.server
sudo path/to/mysql.server start
This should work on *nix OS
eg sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start for mac osx
In The xampp folder you should find the start mysql batch file. Run it, The firewall might ask if you want to allow it through ( So check your firewall if it lets mysqld.exe through )
OP did not provide enough information, however this (and other errors) can be caused by the default MySQL port (3306) being used. If this is the case, you can solve it like this:Go to: XAMPP Control Panel -> MySQL: "Config" button -> my.ini Change the port number from 3306 to a different valid port number. I just used 3307.You can find out more information about your problem by looking at the error log file. This is found here: XAMPP Control Panel -> MySQL: "Logs" button -> mysql_error.log
Running the "setup_xampp.bat" file located in the root directory of Xampp did the trick for me.
Though this is late, I'm sure it would help someone in future.
First run which mysql.server to know where mysql is located on your machine. After then run sudo /usr/local/bin/mysql.server stopto be sure that no other mysql process is running. If no other process is running, you would definitely get an error saying MySQL server PID file could not be found!. That's fine.
After then run sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start to start Xampp's mysql server. When you go to the Xampp GUI, you should see that mysql status as running.
Please note that this is for OS X users.
I face same issue. I installed xampp in D drive.
I uninstall and install setup as run as administrator. Again face same issue.
I searched and try lot of suggestion but no luck.
I solve the problem by right click on xampp and open as Administrator and xampp start working fine.
I was not able to start MySQL service. When I checked mysql log it said:
[ERROR] mysqld: File 'C:\xampp\mysql\data\aria_log_control' not found (Errcode: 13 "Permission denied")
[ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file 'C:\xampp\mysql\data\aria_log_control'
I checked suggested location in the log and file was present.
I found I was doing silly mistake, Since UAC is activated in my PC, I had to start XAMPP using "Run As Administrator".
It worked fine for me.