Can someone please tell me how to enable my.cnf options in CentOS 6?
I have all the expected .cnf files in /usr/share/mysql but they simply don't work.
/etc/init.d/mysqld --help --verbose
Usage: /etc/init.d/mysqld {start|stop|status|restart|condrestart|try-restart|reload|force-reload}
Default location is /etc/my.cnf as far as I'm aware of. Maybe you should try and copy them over there and restart?
my.cnf should be placed in /etc/ like /etc/my.cnf
The solution was to place the my.cnf file in /etc/mysql/my.cnf
the init.d script mysqld relais on the script in /usr/bin/my_print_defaults ..
this scripts takes as first input the "domain", e.g. mysqld_safe oder mysqld and outputs the config ..
this script merges the .cnf files from /etc/mysq/my.cnf + /etc/my.cnf + ~/.my.cnf together and outputs key=value pairs in the form of ..
]# /usr/bin/my_print_defaults mysqld
--datadir=/var/lib/mysql
--socket=/var/lib/mysql/mysql.sock
--user=mysql
--symbolic-links=0
so placing the .cnf files in /usr/share/mysql might be wrong ..
Related
hy guys,
i had a problem with mysqld_multi since 2 days.
I had to run fsck because i had a problem with the hard drive after this i encounter this issue.
When i try to start mysqld_multi with verbose i receive this error:
WARNING: mysqld_safe is beign used to start mysql. In this case you may need to pass "ledir=..." under groups [mysqldN] to mysqld_safe in order to find the actual mysqld binary. ledir (library executable directory) should be the path to the wanted mysqld binary.
This is my my.cnf
[mysqld_multi]
mysqld=/usr/bin/mysqld_safe
mysqladmin=/usr/bin/mysqladmin
log=/var/log/mysqld_multi.log
user=multi_admin
password=secret
[mysqld1]
port=1111
datadir=/var/lib/mysql-databases/mysqld1
pid-file=/var/lib/mysql-databases/mysqld1/mysql.pid
socket=/var/lib/mysql-databases/mysqld1/mysql.sock
user=mysql
server-id=1111
relay-log=/var/log/mysql1/mysql-relay-bin.log
log_bin=/var/log/mysql1/mysql-bin.log
binlog_do_db=database1
i hope somebody could help me
thanks
First, you need to find the mysqld file location.
[root#xyz ~]# find / -name mysqld
/usr/libexec/mysqld
[root#xyz ~]#
Then you need just to add the following lines to your my.cnf file.
[mysqld_multi]
mysqld=/usr/bin/mysqld_safe
mysqladmin=/usr/bin/mysqladmin
log=/var/log/mysqld_multi.log
user=multi_admin
password=secret
[mysqld1]
port=1111
datadir=/var/lib/mysql-databases/mysqld1
pid-file=/var/lib/mysql-databases/mysqld1/mysql.pid
socket=/var/lib/mysql-databases/mysqld1/mysql.sock
user=mysql
server-id=1111
relay-log=/var/log/mysql1/mysql-relay-bin.log
log_bin=/var/log/mysql1/mysql-bin.log
binlog_do_db=database1
mysqld=mysqld_safe ---> only script name of mysqld_safe
ledir=/usr/libexec --> location of mysqld file
OS: Mac OS X Hi Sierra(10.13.1)
MySQL: 5.7.20 (install by homebrew)
I want to enable bin log, so I should edit my.cnf file,
I typed below command to find my.cnf file
mysql --verbose --help | grep my.cnf
and result
/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf
/etc/my.cnf, /etc/mysql/my.cnf isn't exist in my mac.
So, I edit /usr/local/etc/my.cnf file.
[mysqld]
bind-address = 127.0.0.1
log-bin = ~/log
and I start mysql but it can't start.
mysql.server start
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/var/mysql/*.pid).
When I remove bin-log in my.cnf, it can start!
How can I enable bin log??
Standby counsel
I missed server-id property in my.cnf...
I installed mysql 5.6 on Ubuntu Server 16.04 using this method: https://askubuntu.com/questions/762384/install-mysql-5-6-on-ubuntu-16-04
But i'm having trouble getting mysqld to read /etc/mysql/my.cnf
Specifically i'm trying to set it up for an Atlassian Confluence installation where I have to add in these settings:
[mysqld]
character-set-server=utf8
collation-server=utf8_bin
default-storage-engine=INNODB
max_allowed_packet=256M
innodb_log_file_size=2G
I've checked mysqld --help --verbose and it has the my.cnf in its path. Here's the relevant output:
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf The following
groups are read: mysqld server mysqld-5.6
I know that mysql is reading the file because if I change [mysqld] to [mysql] the arguments are correctly printed when I run mysql --print-defaults also if I put a wrong line in the file mysql will fail to start and tell me where the syntax error is. However mysqld does not report any arguments for mysqld --print-defaults or tell me about syntax errors in the file.
What else can I try?
Solved:
my.cnf was a symbolic link. I deleted it and made it an actual file. Now mysqld --show-defaults is working! So apparently mysql will follow the symlink but mysqld will not. Good to know.
my.cnf was a symbolic link. I deleted it and made it an actual file. Now mysqld --show-defaults is working. So apparently mysql will follow the symlink but mysqld will not.
For mysqld as I know only hard links works. Or maybe you just had wrong permission, on original my.cnf file to which you put symbolic link.
I recently removed mysql 5.1 an installed mysql 5.6 on my CENTOS 6 x86 OS.
When I try to look for the my.cnf file it is missing from these directories:
mysqld --verbose --help | grep -A 1 "Default options"
=
/etc/my.cnf, /etc/mysql/my.cnf, and ~/.my.cnf.
Now I went to my mysql home directory which is /var/lib/mysql to find the .cnf file but all I found was auto.cnf.
Does anyone have any ideas? Could I just download a my.cnf file and place it in one of those directories?
sudo updatedb && locate my.cnf
if you are having trouble with locate
as root: find / -name my.cnf
how did you install mysql? with yum?
I am running Centos 6.5. When I went to install MySQL-server.X86_64 5.6.12-2.el6, it put my.cnf in /usr. /usr/my.cnf ? What the hell is my.cnf doing in /usr ?
I found it using find / -iname my.cnf -print
The location is changed to /mysql.d, and the filename is changed to something like mysqld.cnf. Also, there's a similar question somewhere (maybe duplicate here or there).
I can't seem to find the my.cnf or other config file for the MySQL that comes with MAMP. Does it not include one?
The MySQL server of MAMP (not PRO) will be started without any my.cnf file. But you can create your own my.cnf file.
Stop servers
Create a my.cnf file in /Applications/MAMP/conf/
Add your content in to my.cnf
Save my.cnf
Start servers
You do not have to put a complete configuration in the my.cnf file. You can just add parts of a configuration ... for example:
[mysqld]
max_allowed_packet = 64M
Some standard my.cnf variants can be found at /Applications/MAMP/Library/support-files/
Invoking mysqld --verbose --help | less on the MAMP mysqld binary reports:
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /Applications/MAMP/conf/my.cnf ~/.my.cnf
Copy one of the variants in /Applications/MAMP/Library/support-files/ to one of the locations in mysqld's search order above, and you should be good to go after restarting the daemon.
Since MAMP server generates my.cnf dynamically on MAMP server startup, it's best to use the following steps to add or edit the MySQL configuration:
Stop MAMP server
Goto Files > Edit Template > MySQL
Make the necessary changes and save
Restart MAMP
I tried this on MAMP PRO 3.5.
For MAMP 3.5 on Mac El Capitan, only this worked for me:
Stop servers
Create a my.cnf file in /Applications/MAMP/Library/
Add your content into my.cnf like
[mysqld]
max_allowed_packet = 64M
Save my.cnf
Start servers
Not required to change ownership of file, it should work. Verify by running SHOW VARIABLES in phpmyadmin and look for your changed setting.
No, it doesn't come with the my.cnf file
I found that MAMP PRO will create a my.cnf by default on startup under the MAMP/tmp directory if a ~/my.cnf is not provided ... grepping ps aux you may find the default location under /Applications/MAMP/tmp/my.cnf ...
ps aux | grep mysql
Which provided the following...
root 284 0.0 0.1 2435544 532 ?? Ss 12:00AM 0:00.06 /bin/sh /Applications/MAMP/Library/bin/mysqld_safe
--defaults-file=/Applications/MAMP/tmp/mysql/my.cnf
--port=8889 --socket=/Applications/MAMP/tmp/mysql/mysql.sock
--user=mysql --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid
--log-error=/Applications/MAMP/logs/mysql_error_log.err
--tmpdir=/Applications/MAMP/tmp/mysql/tmpdir
--datadir=/Library/Application Support/appsolute/MAMP PRO/db/mysql