MySQL Max_connections Error!

Discussion in 'Systems Administration' started by Shadow., Oct 30, 2017.

  1. Hello guys,

    i have a VPS that i host my minecraft server on it, so i have a lot of servers and in those servers there is a lot of plugins that uses MySQL database since i have Bungeecord, and MySQL make them connected with the database, so i was using it, and once i saw some Connections Errors in the consoles about MySQL ( not being able to connect ) i gone to check by entering it with Phpmyadmin as ( MyVPSIP/phpmyadmin/ )
    and it didn't let me login and it said " too many connections "
    i gone to check why, and i found that The Max_connections is 214 connections at once
    so my plugins used them all ... so i turned off some servers to be able to login and fix others ... anyway
    i gone to increase it ( try to )
    i found this link, http://wikiurls.com/?https://www.electrictoolbox.com/update-max-connections-mysql/
    and a lot of others
    they all say do

    set global max_connections = 500;
    or any number whatever

    when i try this on my console on PuTTY i get this upload_2017-10-30_16-9-55.png
    mysql> set global max_connections = 500;
    ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation


    so idk what to do :( please anyone help me ....
    I have full access to the Root in the VPS and i have everything
    i just don't know how to fix this :(

    Please help
     
  2. Reboot the mysql server or the vps/dedi
     
  3. Listen im not asking for a way to make the connections less, im asking for a way to increase the limit, what do i get when i restart it ?
    less connections ? of course not, because the same plugins will connect so how this is less ?
    what do you solve ? nothing.
     
  4. which pass did you enter, the database in question's password, for that user who has access to that database inside the mysql server, or the mysql's :"root" user's password?
     
  5. According to the screenshot the OP logged in with the mysql's root user
    You don't have to being so rude to someone else that's trying to help you.

    EDIT: I can't reproduce the problem with multiple servers which are using more then 300 connections in total.
     
  6. The screenshot doesn't show which username he used for the mysql server. He is on his linux box as a root user ~ i guess when you don't provide -u in cli that the logged in user's username is adapted by mysql server. Okay, that's fine. I am used to sudo commands where needed and using mysql -u to guarantee im getting asked the right pass for the right user. Technically the 'root' user on the os isn't the same as the 'root' user on the mysql daemon, hence why they have different passwords.

    But yeah. you're right. i see the # prompt.

    https://dev.mysql.com/doc/refman/5.7/en/too-many-connections.html
    https://dev.mysql.com/doc/refman/5.5/en/user-resources.html
     
  7. sorry for making it sound rude

    but what do you mean of I can't reproduce the problem with multiple servers which are using more then 300 connections in total.
     
  8. im on root user
    but i want to know how to increase max_connections
    i don't think i need sudo if i have root user, and i even tried with sudo but same thing
    and i tried to do mysql -u
    but same , so what do you think i should do ?
     
  9. MikeA

    Retired Supporter

    That will work fine by default, so there's something wrong with your root user privileges, because this isn't how MySQL comes after install. Maybe re-run the mysql_secure_installation or something, or go into PMA to check [email protected] privileges.
     
  10. How ?
    Explain more please
     
  11. Anyone Please ?
     
  12. CREATING USERS AND DATABASES
    To create a MySQL database and user, follow these steps:

    1. At the command line, log in to MySQL as the root user:
      mysql -u root -p
    2. Type the MySQL root password, and then press Enter.

    3. To create a database user, type the following command. Replace username with the user you want to create, and replace password with the user's password:

      GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';
      This command grants the user all permissions. However, you can grant specific permissions to maintain precise control over database access. For example, to explicitly grant the MAX_CONNECTIONS permission, you would use the following command:

      GRANT MAX_CONNECTIONS ON *.* TO 'username'@'localhost';

    4. Type \q to exit the mysql program.

    5. To log in to MySQL as the user you just created, type the following command. Replace username with the name of the user you created in step 3:

      mysql -u username -p
    6. Type the user's password, and then press Enter.
     
  13. 2017-10-31 12_42_29-root@vmi139798_ ~.png
    i tried to do the commands
    look at i got
    i don't think i have access to do anything :( idk why, help please
     
  14. you didn't enter your password....Identified by ****** should be password silly :)
     
  15. i didn't change the username or password because i just want to test
    but still i keep getting this same error about not having permission :( like wtf ... help please ;(
     
  16. no it asked me to enter it and i did after i logged in with mysql -u root -p
     
  17. wait the password should be mine ? my account's ? the root one ?
     
  18. If you have root access yes if not contact the guy who does.
     
  19. i do and i tried look
    2017_10_31_12_45_49_root_vmi139798_.png
     
  20. GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password'; <<<<<<This last item needs to be your password again to grant that access.
     

Share This Page