Installation of MySQL On Linux Sample
Installation of MySQL On Linux Sample
Notes:
1. Create a new user/group for your MySQL service and add ‘oracle’ group to opc. Usually the is used
the user “mysql”, but because he’s already available we show here how create a new one
2. Close the SSH connection and open a new one to let opc user have the new group.
ssh -i ~/.ssh/id_rsa opc@[server ip]
5. Create a symbolic link to datadir (this help when you upgrade the software)
shell> sudo ln -s mysql-commercial-8.0.17-linux-glibc2.12-x86_64
bin
6. Create a new configuration file my.cnf inside /mysql/etc with these lines inside
(e.g. with “sudo vi /mysql/etc/my.cnf” or “sudo nano /mysql/etc/my.cnf”)
[mysqld]
# General configurations
port=3307
mysqlx_port=33070
server_id=10
socket=/mysql/temp/mysql.sock
user=oracle
# File locations
basedir=/mysql/bin
plugin-dir=/mysql/bin/lib/plugin
datadir=/mysql/data
tmpdir=/mysql/temp
log-error=/mysql/log/err_log.log
general_log_file=/mysql/log/gl_log.log
slow_query_log_file=/mysql/log/sq_log.log
# Maximum limits
max-connections=200
open-files-limit=5000
# InnoDB settings
innodb_flush_log_at_trx_commit=1
innodb_buffer_pool_size=512M
# MyISAM settings
key_buffer_size=124M
# Performance Monitor
performance_schema_consumer_events_statements_history_long = ON
11. Another way is search the message “ready for connections” in error log as one of the last
shell> netstat -an | grep 3307
13. Before version 5.7 it was recommended to run the ' mysql_secure_installation ' script. From version
5.7 all these settings are “by default”, but the script can be used also to setup the validate_password
plugin (used later). Execute now mysql_secure_installation
14. Login to you mysql-advanced installation and check the status (you will be asked to change
password)
shell> mysql -uroot -p -h 127.0.0.1 -P 3307
mysql> status
15. Create a new administrative user called 'admin' with remote access and full privileges
mysql> CREATE USER 'admin'@'%' IDENTIFIED BY 'Welcome1!';