MySQL

This is used for general discussion that is not necessarily server-related.
Post Reply
Noonie
New to forums
New to forums
Posts: 6
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Mon Sep 07, 2015 4:25 pm

MySQL

Post by Noonie »

Temporary solution to maxing connections,
show variables like "max_connections";
set global max_connections = 200;

I need help with the following:

To make the change permanent you need to edit the my.cnf configuration file. Where do I find this file on my VPS? I'm not using wamp/xamp. I'm trying to make a permanent change to the max connections so I don't have to keep doing it everytime I restart Mysql.

I'm using MySQL Server 5.5 and workbench 6.3
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: MySQL

Post by soja »

The file is usually at /etc/mysql/my.cnf, or /etc/my.cnf.

There are multiple location of the config file, and mysql checks all of them when it starts up. I just did a mysql install on ubuntu 15.04 and the default config file was at the first location I listed. If your config file is not at either of those locations, you can create a new one.
Not a NFO employee
Noonie
New to forums
New to forums
Posts: 6
Joined: Mon Sep 07, 2015 4:25 pm

Re: MySQL

Post by Noonie »

Normally "/etc/mysql/my.cnf, or /etc/my.cnf." I would right click xamp or wamp at the bottom right in the taskbar. Now, I am not using xamp or wamp. In fact, before I took over this database my friend was working on it and doesn't know either. So where would I look to find "/etc/mysql/my.cnf, or /etc/my.cnf."

Assume that I am a novice that does not know where to locate this please and thank you.

@soja
[Mention]soga[/mention] (lool).
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: MySQL

Post by soja »

Noonie wrote:Normally "/etc/mysql/my.cnf, or /etc/my.cnf." I would right click xamp or wamp at the bottom right in the taskbar. Now, I am not using xamp or wamp. In fact, before I took over this database my friend was working on it and doesn't know either. So where would I look to find "/etc/mysql/my.cnf, or /etc/my.cnf."

Assume that I am a novice that does not know where to locate this please and thank you.

@soja
[Mention]soga[/mention] (lool).
Oh my bad, my instructions were for Linux. On Windows the file is called my.ini, this link should be able to help you:

http://stackoverflow.com/questions/1712 ... s-computer
Not a NFO employee
Noonie
New to forums
New to forums
Posts: 6
Joined: Mon Sep 07, 2015 4:25 pm

Re: MySQL

Post by Noonie »

I located a file called my-default.ini

under [mysqld]

if i put

[mysqld]
max_connections = 10000;


would that be good?
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: MySQL

Post by soja »

Noonie wrote:I located a file called my-default.ini

under [mysqld]

if i put

[mysqld]
max_connections = 10000;


would that be good?
Don't put [mysqld] twice, and you might want to rename the file to my.ini. It should work.
Not a NFO employee
Noonie
New to forums
New to forums
Posts: 6
Joined: Mon Sep 07, 2015 4:25 pm

Re: MySQL

Post by Noonie »

I renamed the file to my.ini and I added the statement you provided (just the one mysqld not two).

When I restarted mysql and checked the max connections through show variable etc, it displayed 151 instead of 10000. Is that normal?
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: MySQL

Post by soja »

Noonie wrote:I renamed the file to my.ini and I added the statement you provided (just the one mysqld not two).

When I restarted mysql and checked the max connections through show variable etc, it displayed 151 instead of 10000. Is that normal?
As the root mysql user, try running this SQL statement:

SET GLOBAL max_connections = 10000;

Then check the value of the variable.
Not a NFO employee
Noonie
New to forums
New to forums
Posts: 6
Joined: Mon Sep 07, 2015 4:25 pm

Re: MySQL

Post by Noonie »

That's a temporary solution, once you restart sql it will set back to 151 or w.e your default value is =\

Well i'm beat :S
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: MySQL

Post by soja »

Noonie wrote:That's a temporary solution, once you restart sql it will set back to 151 or w.e your default value is =\

Well i'm beat :S
I know, I wanted to check if it changed with that statement, based on your response the answer is yes.

Place the my.ini in the root of your C drive, see if that works.
Not a NFO employee
Post Reply