XAMPP on macOS - mysqld: Please consult the Knowledge Base to find out how to run mysqld as root! [ERROR] Aborting - xampp

Today XAMPP on macOS Monterey will not start mySQL.
The error log shows:
2021-12-20 12:44:37 25199 mysqld_safe Starting mysqld daemon with
databases from /Applications/XAMPP/xamppfiles/var/mysql Warning:
World-writable config file '/Applications/XAMPP/xamppfiles/etc/my.cnf'
is ignored 2021-12-20 12:44:37 0 [Note]
/Applications/XAMPP/xamppfiles/sbin/mysqld (mysqld 10.4.21-MariaDB)
starting as process 25273 ... 2021-12-20 12:44:37 0 [Warning] Setting
lower_case_table_names=2 because file system for
/Applications/XAMPP/xamppfiles/var/mysql/ is case insensitive
/Applications/XAMPP/xamppfiles/sbin/mysqld: Please consult the
Knowledge Base to find out how to run mysqld as root! 2021-12-20
12:44:37 0 [ERROR] Aborting 2021-12-20 12:44:37 25199 mysqld_safe
mysqld from pid file
/Applications/XAMPP/xamppfiles/var/mysql/Mandoes-Mac-mini.local.pid
ended

The solution was to remove read/write access from Admin & Everyone, and keep read/write access for System only.

Open Terminal
Navigate to the XAMPP config folder
cd /Applications/XAMPP/xamppfiles/etc/
Set permissions of my.cnf to 600
sudo chmod 600 my.cnf
Restart MySQL.

Related

Remove NO_ZERO_DATE flag from mysql workbench to enable SuiteCRM to work correctly

I need to remove NO_ZERO_DATE flag from mysql workbench. It is stopping SuiteCRM from operating correctly. Removes my ability to create campaigns for example and throws up numerous errors.
Unfortunately I a root user and using my SSH client I can type in commands but it is BASH which uses slightly different commands what I find online. I am not sure exactly what to type in order to remove the NO_ZERO_DATE flag and I am not sure if I should entirely remove Strict Mode, which it appears to be.
I am using
GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)" adn the commands are slightly different
I work in SQL in MYSQLworkbench 6.3 CE
I know this is likely a very simple question for someone with the correct knowledge, I just need to know exactly what to type to remove the flag.
New action with error
Ran [root#server ~]# mysqld --sql mode="NO_ENGINE_SUBSTITUTION"
got
[root#server ~]# mysqld --sql mode="NO_ENGINE_SUBSTITUTION"
2018-09-19T13:58:48.915959Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-09-19T13:58:48.917012Z 0 [Note] mysqld (mysqld 5.7.23) starting as process 23382 ...
2018-09-19T13:58:48.918011Z 0 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2018-09-19T13:58:48.918039Z 0 [ERROR] Aborting
2018-09-19T13:58:48.918071Z 0 [Note] Binlog end
2018-09-19T13:58:48.918114Z 0 [Note] mysqld: Shutdown complete
Tried root#server ~]# mysqld --sql mode="NO_ZERO_DATE"
[ root#server ~]# mysqld --sql mode="NO_ZERO_DATE"
2018-09-19T14:00:18.665452Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-09-19T14:00:18.666463Z 0 [Note] mysqld (mysqld 5.7.23) starting as process 23484 ...
2018-09-19T14:00:18.667446Z 0 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2018-09-19T14:00:18.667490Z 0 [ERROR] Aborting
2018-09-19T14:00:18.667508Z 0 [Note] Binlog end
2018-09-19T14:00:18.667551Z 0 [Note] mysqld: Shutdown complete
You should change the default sql_mode for mysql.
Usually the default has the NO_ZER_DATE set, you can just take that option ouy so uou can set it to:
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
You can either do that on the mysql config file (this is what you want to make suitecrm run ok) or for the session doing something like SET sql_mode = 'NO_ENGINE_SUBSTITUTION' ; (this command is a mysql query)
Look for your mysql config file, in ubuntu is located in
/etc/mysql/conf.d/mysql.cnf
Add the sql-mode line with something like this:
[mysqld]
sql-mode="NO_ENGINE_SUBSTITUTION"

Unable To Login Via Default Login Credentials of Admin in Ambari

I installed hortonworks sandbox around two weeks ago on a cloud server of linode with a machine of 8GB RAM. I access this node of Linode via Putty.
Everything is working fine. Also, I am able to login Ambari via the default login credentials like maria_dev, raj_ops, holger_gov and amy_ds.
But I am unable to login via the default login credentials of admin. I think that I've forgotten the password. Since I am really new to this framework, I am unable to recover the password. In the command line, I tried the following commands :
ambari-server restart
ambari-admin-password-reset
But each time, I am getting the command not found error.
Can someone please help me to recover the password ? or help me to login via the login credentials of admin ?
If you get the "command not found error" on ambari-server restart command, then probably you are logged into a wrong cluster node. Ambari-server is installed to a single host of a cluster.
Solution 1:
Ambari server failing, Check if Ambari server is running or not by following command
ps -aux | grep ambari
If you can not find ambari server process, please check a log for ambari-server. You can find ambari-server logs at /var/log/ambari-server/ambari-server.log
Ambari-server is Running but its missing from PATH please check if ambari-server is actually running ?
[root#sandbox ~]# ps aux | grep ambari-server
root 9 0.0 0.0 11356 1288 ? S+ 12:24 0:00 /bin/sh -c ambari-server start 1>/var/log/startup_script.log 2> "temp Ambari server.log" || touch temp.errors;
root 15 0.0 0.0 11360 1388 ? S+ 12:24 0:00 bash /usr/sbin/ambari-server start
root 46 0.8 0.3 116772 15168 ? D+ 12:24 0:01 /usr/bin/python /usr/sbin/ambari-server.py start
root 2324 0.0 0.0 8024 844 pts/0 R+ 12:26 0:00 grep ambari-server
Solution 2:
Try to find out where Ambari is Installed.
find / -name "ambari-server"
Try running ambari-server --help with full path. It will print following message as below.
[root#sandbox ~]# /usr/sbin/ambari-server --help
Using python /usr/bin/python
Usage: /usr/sbin/ambari-server
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|enable-stack|check-database|db-cleanup} [options]
Use /usr/sbin/ambari-server.py <action> --help to get details on options available.
Or, simply invoke ambari-server.py --help to print the options.
In case /usr/sbin/ missing from path then you have to manually add PATH with export PATH=$PATH:/usr/sbin

Mac OSX - mongod and mongo not working

I'm completely new to databases and am trying to set up mongodb.
I've followed all the steps but neither the mongod or mongo commands work.
This is the output from mongod:
ERROR: could not read from config file
That is followed by all the mongo options (-h, -f, -v, etc.)
This is the output from mongo:
MongoDB shell version: 2.4.6
connecting to: test
Fri Sep 6 22:55:35.889 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
exception: connect failed
Any help is appreciated!
Try starting mongod with --config option specified. Something like /path/to/mongod --config /path/to/mongodb.conf.
In your mongodb.config check the location to the mongodb log. You should find additional details about errors there. Possible problems are: db path does not exist or is not writable, after an unclean shutdown mongod.lock file still exists etc.

install mongoDB (child process failed, exited with error number 100)

I tried to install mongoDB on my macbook air.
I've downloaded zipped file from official website and extract that file and move to root directory.
After that, under that directory, I've made /data/db and /log folder.
Here is my mongodb.config which describes the basic config for my DB.
dbpath = /mongodb/data/db
logpath = /mongodb/log/mongo.log
logappend = true
#bind ip = 127.0.0.1
port = 27017
fork = true
rest = true
verbose = true
#auth = true
#noauth = true
Additionally, I want to know what the # means in the config file.
I put this file to /mongodb/bin, /mongodb is the directory I extracted the files into.
I opened terminal and entered ./mongod --config mongodb.config and I got this back.
Juneyoung-ui-MacBook-Air:bin juneyoungoh$ ./mongod --config mongodb.config
about to fork child process, waiting until server is ready for connections.
forked process: 1775
all output going to: /mongodb/log/mongo.log
ERROR: child process failed, exited with error number 100
How can I handle this error and what this means?
The data folders you created were very likely created with sudo, yes? They are owned by root and are not writable by your normal user. If you are the only user of your macbook, then change the ownership of the directories to you:
sudo chown juneyoungoh /data
sudo chown juneyoungoh /data/db
sudo chown juneyoungoh /data/log
If you plan on installing this on a public machine or somewhere legit, then read more about mongo security practices elsewhere. I'll just get you running on your macbook.
I had a similar issue and it was not related to any 'sudo' problem. I was trying to recover from a kernel panic!
When I look at my data folder I found out a mongod.lock file was there. In my case this page helped a lot: http://docs.mongodb.org/manual/tutorial/recover-data-following-unexpected-shutdown/. As they explain,
if the mongod.lock is not a zero-byte file, then mongod will refuse to start.
I tested this solution in my environment and it works perfectly:
Remove mongod.lock file.
Repair the database: mongod --dbpath /your/db/path --repair
Run mongod: mongod --dbpath /your/db/path
There was the same problem on my machine. In the log file was:
Mon Jul 29 09:57:13.689 [initandlisten] ERROR: Insufficient free space for journal file
Mon Jul 29 09:57:13.689 [initandlisten] Please make at least 3379MB available in /var/mongoexp/rs2/journal or use --smallfiles
It was solved by using mongod --smallfiles. Or if you start mongod with --config option than in a configuration file disable write-ahead journaling by nojournal=true (remove the beginning #). Some more disk space would also solve the above problem.
It's because you probably didn't shutdown mongodb properly and you are not starting mongodb the right way. According your mongodb.config, you have dbpath = /mongodb/data/db - so I assume you created the repository /mongodb/data/db? Let me clarify all the steps.
TO START MONGODB
In your mongodb.config change the dbpath = /mongodb/data/db to dbpath = /data/db. On your terminal create the db repository by typing: mkdir /data/db. Now you have a repository - you can start your mongo.
To start mongo in the background type: mongod --dbpath /data/db --fork --logpath /dev/null.
/data/db is the location of the db.
--fork means you want to start mongo in the background - deamon.
--logpath /dev/null means you don't want to log - you can change that by replacing /dev/null to a path like /var/log/mongo.log
TO SHUTDOWN MONGODB
Connect to your mongo by typing: mongo and then use admin and db.shutdownServer(). Like explain in mongoDB
If this technique doesn't work for some reason you can always kill the process.
Find the mongodb process PID by typing: lsof -i:27017 assuming your mongodb is running on port 27017
Type kill <PID>, replace <PID> by the value you found the previous command.
Similar issue with the same error - I was trying to run the repair script
sudo -u mongodb mongod -f /etc/mongodb.conf --repair
Checked ps aux | grep mongo and see that the daemon was running. Stopped it and then the repair script run without an issue.
Hope that could be helpful for someone else.
I had the same error on linux (Centos) and this worked for me
Remove mongod.lock from the dbpath
$ rm /var/lib/mongo/mongod.lock
Repair the mongod process
$ mongod --repair
Run mongod config
$ mongod --config /etc/mongod.conf
I had the same error. I ran it interactively to see the log.
2014-10-21T10:12:35.418-0400 [initandlisten] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017
Then I used lsof to find out which process was using my port.
$ lsof -i:27017
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mongod 2106 MYUSERID 10u IPv4 0x635b71ec3b65b4a1 0t0 TCP *:27017 (LISTEN)
It was a mongod that I had forked previously and forgot to turn off (since I hadn't seen it running in my bash window).
Simply killing it by running kill 2106, enabled my process to run without the error 100.
Generally, this error comes when the mongod.conf file is not able to
find a certain path for
Database store
or log store
or maybe processid store
or maybe it's not getting the file permission to access the config directories and files which has been declared in mongod.conf
to resolve this error we need to observe the log generated by the MongoDB
it will clearly indicate whether which file or directory you MongoDB is not able to access
the above error may look like below screenshot
create folder "data" and "db" inside it, in "/" path of your server.
actually you should create or modify permissions of folder that the data is going to be stored!

How to resolve this PostgreSQL error on OS 10.6 (Snow Leopard)

I followed the instructions for setting up postgresql from this site
All seems to go fine until I try:
createuser --superuser myname -U
postgres
I get the following exception:
createuser: could not connect to
database postgres: could not connect
to server: No such file or directory
Is the server running locally and
accepting connections on Unix domain
socket "/tmp/.s.PGSQL.5432"?
For the life of me I can't figure out how to resolve this. Any ideas???
I had to remove the existing postgres user before doing the install.
Perhaps you moved your postgres data directory after you installed postgres using macports
Find where your launchctl startup script is located.
ps -ef | grep postgres
Outputs
0 54 1 0 0:00.01 ?? 0:00.01 /opt/local/bin/daemondo --label=postgresql84-server --start-cmd /opt/local/etc/LaunchDaemons/org.macports.postgresql84-server/postgresql84-server.wrapper start ; --stop-cmd /opt/local/etc/LaunchDaemons/org.macports.postgresql84-server/postgresql84-server.wrapper stop ; --restart-cmd /opt/local/etc/LaunchDaemons/org.macports.postgresql84-server/postgresql84-server.wrapper restart ; --pid=none
So I edit
sudo vim /opt/local/etc/LaunchDaemons/org.macports.postgresql84-server/postgresql84-server.wrapper
And find the line
Start() {
su postgres -c "${PGCTL} -D ${POSTGRESQL84DATA:=/opt/local/var/db/postgresql84/wrong_place} start -l /opt/local/var/log/postgresql84/postgres.log"
}
Ahh.. my data directory is in the wrong place. I fix it by changing
/opt/local/var/db/postgresql84/wrong_place
to
/opt/local/var/db/postgresql84/right_place
for both the start and stop command.
Did you install the postgresql84-server port? If so, did you start the server:
$ sudo port load postgresql84-server
If you did both of those, I've noticed that sometimes the MacPorts daemon handler (daemondo) doesn't start handling requests for PostgreSQL until you restart your machine. (This only happens the first time it is started; subsequent attempts should work fine.)

Resources