Install and Setup MySQL 5.6 on CentOS - saviovettoor/DevOps-wiki GitHub Wiki
Install MySQL Community Server
- Add mysql community into your rpm repo
# yum install http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
- Install mysql
# yum install mysql-community-server
- Start mysql
# systemctl start mysqld
- Verify the Service is running
# ps aux | grep mysql
mysql 2925 0.0 0.1 115216 1672 ? Ss 04:05 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 3076 0.6 10.8 696716 109480 ? Sl 04:05 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --pl=/var/lib/mysql/mysql.sock
root 3102 0.0 0.0 112640 976 pts/0 R+ 04:06 0:00 grep --color=auto mysql
- Modify the config file to optimize your mysql
# vi /etc/my.cnf
[mysqld]
max_allowed_packet = 500M
IF YOUR ARE SEEING THE BELOW ERROR WHEN TRYING PUBLISH REPORT IN SONARQUBE THEN THE UPDATE max_allowed_packet in /etc/my.cnf
04:13:57.939 DEBUG: Upload report
04:14:11.533 DEBUG: POST 500 sonarserverurl/api/ce/submit?projectKey=Somename&projectName=Somename | time=13580ms
04:14:11.540 INFO: ------------------------------------------------------------------------
04:14:11.540 INFO: EXECUTION FAILURE
04:14:11.540 INFO: ------------------------------------------------------------------------
04:14:11.540 INFO: Total time: 2:25.443s
04:14:11.639 INFO: Memory: 48M/1742M
04:14:11.639 INFO: ------------------------------------------------------------------------
04:14:11.639 ERROR: Error during SonarQube Scanner execution
- Restart your mysql service
# systemctl restart mysqld
Configure MySQL
- Login as root user
# mysql -u root -p
Default their won't be any password for root
This will prompt for a password, type the root password that you want to use and press enter. Now your root user is secured with the new password. Please make a note of the password.