mysql server stops while initializing hybris on mac os - mysql

Just to share my experience of setting up Hybris for the first time on macOS.
Problem:
My hybris server and MySQL server got started without any issue, but as soon as I did an initialization on Hybris from HAC, mySQL server gets stopped after some time and initialization stuck in between. Tried this process multiple times.
I have tried different configurations of mySQL using my.cnf file but got no success.
Hybris version: 6.6.0.3
MySQL version: 5.7.28

Got the final solution that worked for me, below is the set of configurations that i added in /etc/my.cnf file:
[mysqld]
wait_timeout = 6000
interactive_timeout = 6000
bind-address = 127.0.0.1
innodb_flush_log_at_trx_commit=0
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
max_connections=500
max_allowed_packet=1024M
innodb_file_per_table=0
thread_stack=500K
I hope this will help any newcomer setting up Hybris with MYSQL.
Cheers

Related

MySQL Remote connection in CentOS 8

I have a CentOS 8 server(Server-1) with mysql Server version: 8.0.21 Source distribution with default installation.
I am trying to connect to this mysql server from another server. (Say server-2).
In my CentOS 8 server I can find only below three conf file in folder /etc/my.cnf.d/.
client.cnf mysql-default-authentication-plugin.cnf mysql-server.cnf
As searched to connect to this server from remote sever I need to enable below line in my.cnf
bind-address = 0.0.0.0
But my.cnf is as shown below.
[client-server]
!includedir /etc/my.cnf.d
In short i am confused with this mysql-8 configuration in CentOS 8. Where is bind-address directive located in ? Where is my mysql other configuration located in ?
Help me guys!!
Why Don't you install WHM/cPanel over it
This will be easy because it have a option for it.
And you can have a trail license of the WHM/cPanel if you are resolving with the money.
you can find more over here
https://docs.cpanel.net/installation-guide/install/
hope it may help you.
Thanks
#The next level coders

ERROR MY-010270 Server Bind on unix socket: input/output error Windows 10

I tried creating a MySQL image using Docker in PhpStorm. But it's giving me this:
ERROR MY-010270 Server Bind on unix socket: input/output error
If you are using docker on Windows 10 and you mount /var/lib/mysql as volume, this happens because windows doesn't support unix sockets.
Maybe is not the best solution, but as a workaround you can change the position in the filesystem of mysql socket editing my.cnf (mysql config file).
in /etc/my.cnf edit as follow:
[client]
socket=/var/run/mysqld/mysql.sock
[mysqld]
socket=/var/run/mysqld/mysql.sock
datadir=/var/lib/mysql
#Davide is right. But for a docker usage it is easier to set
switch --socket=/tmp/mysql.sock when starting the server.
(The problem is related just for Windows host.)

mysql config file change on ubuntu not reflected

I am running an Xubuntu 16.04 machine, and have installed mysql version 5.6. I wanted to change the mysql settings buffer pool size among other things. I tried editing /etc/mysql/my.cnf, /etc/mysql/conf.d/mysql.cnf. Then restarted mysql server. After that, when I login to mysql console and try to print the variables, I still do not see the values I entered in the config files. What am I missing?
EDIT
I have put the settings under [mysqld] section. Below is the content of the above files:
[mysqld]
innodb_buffer_pool_size=4G
innodb_log_buffer_size=512M
innodb_log_file_size=2G
innodb_write_io_threads=16
innodb_flush_log_at_trx_commit=0

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 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.