Hackonology Forums
Installing and Configuring MySQL on Linux - Printable Version

+- Hackonology Forums (https://hackonology.com/forum)
+-- Forum: Technology & Configuration (https://hackonology.com/forum/forumdisplay.php?fid=3)
+--- Forum: System Configuration (https://hackonology.com/forum/forumdisplay.php?fid=4)
+--- Thread: Installing and Configuring MySQL on Linux (/showthread.php?tid=83)



Installing and Configuring MySQL on Linux - SysAdmin - 09-16-2020

The following are example instructions to install and configure MySQL database for the Oracle Linux distribution of Linux operating system:



##Install the MySQL database server package:

sudo yum install mysql-community-server



##Start the MySQL service:



sudo service mysql start



##Launch the MySQL Command-Line Client:



mysql -u root -p

##The -p option is needed only if a root password is defined for MySQL. Enter the password when prompted.



##Create a user (for example, demo) and a strong password:



mysql> create user 'demo' identified by 'demo';



##To restrict the access to a machine (for example, to localhost for a user) create the user as follows:



mysql> create user 'demo'@'localhost' identified by 'demo';



##Create the database (for example, demo) and grant all access to the user, for example, demo as follows:

mysql> create database demo;

mysql> grant all on demo.* to 'demo';



##Configure your MySQL installation to handle large BLOB entries, such as AMC Agent (installation) bundle and MSI binaries. To handle BLOB entries, edit the my.cnf file. For more information, To edit the my.cnf file:

## Open the my.cnf file in an editor. You can find the my.cnf file in one of the following locations:
/etc/my.cnf
/etc/mysql/my.cnf
$MYSQL_HOME/my.cnf
[datadir]/my.cnf

## Set the options max_allowed_packet and innodb_log_file_size in the [mysqld] section to the values shown:
[mysqld]
max_allowed_packet=300M
innodb_log_file_size=768M

## Restart the MySQL service to apply changes.