Questions tagged [my.cnf]

Configuration file for MySQL programs, particularly for the mysqld server.

MySQL programs read one or more option files in .ini format, with sections specific to each program.

The global option file, usually /etc/my.cnf, frequently contains options for the mysqld server and sometimes the mysqldump or isamchk maintenance programs. There are many such options, with complex interactions; fine-tuning them for your specific needs can be out of scope for this site, but ServerFault may be able to help with some general situations.

The user-specific option file, usually ~/.my.cnf, is not often necessary, but can reduce command-line length or help tailor the mysql client to your preferences. For specific advice, SuperUser is probably a better place to look.

219 questions
75
votes
5 answers

MySQL my.cnf file - Found option without preceding group

I'm trying to connect to my DB in Ubuntu remotely but I receive error message when trying to mysql -u root -p: Found option without preceding group in config file: /etc/mysql/my.cnf at line: 1 my.cnf looks like: [mysqld] user = mysql socket…
Afra
  • 2,302
  • 2
  • 22
  • 27
53
votes
14 answers

Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root

I am not sure how to fix this: dyn-72-33-214-45:python mona$ sudo /usr/local/mysql/bin/mysqld stop 2014-09-06 09:49:04 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see…
Mona Jalal
  • 24,172
  • 49
  • 166
  • 311
24
votes
2 answers

MySQL my.cnf performance tuning recommendations

I am kind of hoping that someone might be able to offer some assistance with optimizing a my.cnf file for an extremely high volume mysql database server. Our architecture is as follows: Memory : 96GB CPUs : 12 OS & Mysql : 64-bit Disk…
Skittles
  • 2,728
  • 9
  • 27
  • 34
22
votes
1 answer

Why does `log_slow_queries` break `my.cnf`?

Why can't I use slow_query_log on MySQL 5.6 on CentOS 6.4? [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock ... ## Logging ## *** THESE LOGS WORK JUST FINE *** log_error =…
Ryan
  • 14,115
  • 29
  • 92
  • 163
21
votes
4 answers

Configure time zone to mysql docker container

I have a mysql 5.7 docker container. When I run the mysql command: SELECT now(); It shows the time -3 hours to my current time (which is logical). I want to set the time zone in a config file. Following the documentation in…
vivanov
  • 1,152
  • 1
  • 17
  • 26
16
votes
7 answers

MySQL: setting time_zone in my.cnf options file

In MySQL you can set a session variable called time_zone to change the timezone. This is useful e.g. when looking at timestamps from another country. Here is an example: mysql> select now(); +---------------------+ | now() …
emx
  • 1,245
  • 4
  • 17
  • 27
14
votes
2 answers

What does mysql use if there is no my.cnf?

In short, what configuration values does MySQL use if there is no my.cnf? I'm running MySQL on Slackware. I've been using it for a while with ISAM and InnoDB tables. I never configured a my.cnf file. Oops. Now I'd like to do that, but I don't…
Charles
  • 167
  • 1
  • 1
  • 9
14
votes
2 answers

mysql 5.7 log-slow-queries error

I'm trying to enable Slow Query Logging on mysql 5.7 and getting this error: 2016-04-27T14:55:51.934612Z 0 [ERROR] unknown variable 'log-slow-queries=/var/log/mysql-query.log' 2016-04-27T14:55:51.934639Z 0 [ERROR] Aborting In my /etc/my.cnf file I…
Alby
  • 436
  • 1
  • 7
  • 15
11
votes
1 answer

Mysql connect to server: Access denied for user root@localhost

edit9: Is it a possibility that I'm simply missing a few permissions on folders? I'd really, REALLY appreciate some more suggestions.. edit3: As this post did not get enough replies and it is absolutely vital I get this going as soon as possible I…
L. Klotz
  • 164
  • 1
  • 15
10
votes
3 answers

mysql 5.6 ubuntu 15.04 cannot find correct my.cnf file

I am attempting to move a mysql db onto an upgraded server with a newer version of ubuntu running (15.04), and after installing LAMP, I went to edit the bind address in the my.cnf file. The below is all I see in /etc/mysql/my.cnf. I added [mysqld]…
caro
  • 786
  • 2
  • 13
  • 32
9
votes
5 answers

How to configure MySQL on same machine with different port?

How to configure two different port for MySQL on same machine? I know that default port is 3306. But I also want to configure 3307 and 3308. Is it possible? One bonus question with current one ;) Can we assign Different Ports to Different Databases…
NullPointer
  • 2,620
  • 3
  • 30
  • 56
9
votes
3 answers

Optimal MySQL-configuration (my.cnf)

The following is my default production MySQL configuration file (my.cnf) for a pure UTF-8 setup with InnoDB as the default storage…
knorv
  • 45,461
  • 71
  • 205
  • 289
8
votes
2 answers

How to resolve "specified key was too long max key length is 255 bytes" in mysql?

Whenever i fire this query from one of the mysql client (emma): CREATE TABLE `tbl_mappings` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `private_id` int(11) unsigned NOT NULL, `name` tinytext NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY…
tushar patil
  • 309
  • 1
  • 4
  • 11
7
votes
6 answers

Mysql: modification in my.cnf doesn't take effect

I've updated the my.cnf file of my database with the following line: max_connections=200. I stopped and started the mysql service after that so that the changes would take effect. But for some reason this change doesn't affect the database because…
Ewoud
  • 11,439
  • 4
  • 15
  • 22
7
votes
9 answers

Where can I find the file my.ini file for windows mysql server?

The same question is repeated again and again and i am another one repeating this question . I have already set up my mysql server . Its location is C:\Program Files\MySQL\MySQL Server 5.5 but i am not able to find the my.ini file…
gaurav
  • 317
  • 2
  • 9
  • 20
1
2 3
14 15