Posts

Showing posts with the label msyql

Too many connections” error mysql

$ mysql –u root –p SHOW STATUS LIKE 'max_used_connections'; $ mysql –u root –p mysql> SHOW VARIABLES LIKE 'max_connections'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_connections | 151 | +-----------------+-------+ # vi /etc/my.cnf max_connections = 512 MySQL my.cnf file - Found option without preceding group Just add  [mysqld]  as first line in the  /etc/mysql/my.cnf  file. Example [ mysqld] max_connections = 512 If on Ubuntu try without the 'd' systemctl start mysql

reset root password of mysql

Reference taken from this blog: Step 1: Stop MySQL Service. sudo service mysql stop Step 2: Kill all running mysqld. sudo killall -9 mysqld Step 3: Starting mysqld in Safe mode. sudo mysqld_safe --skip-grant-tables --skip-networking & Step 4: Start mysql client mysql -u root Step 5: After successful login, please execute this command to change any password. FLUSH PRIVILEGES; Step 6: You can update mysql root password . UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root'; for mysql > 5.7 use this instead of above: UPDATE mysql.user SET authentication_string=PASSWORD('newpwd') WHERE User='root'; Step 7: Please execute this command. FLUSH PRIVILEGES; Step 8: Exit mysql console exit Step 9: Kill mysqld_safe and start mysql sudo killall mysqld_safe && sudo service mysql start