Skip to main content

MySQL 8.0.12 Enterprise Edition Installation on Linux

MySQL 8.0.12 Enterprise edition Installation using rpm:

MySQL 8.0.12 enterprise edition require following rpms to install it MySQL database server.

  • mysql-commercial-backup - MySQL Enterprise Backup (added in 8.0.11)
  • mysql-commercial-client - MySQL client applications and tools
  • mysql-commercial-common - Common files for server and client libraries
  • mysql-commercial-devel - Development header files and libraries for MySQL database client applications
  • mysql-commercial-embedded-compat - MySQL server as an embedded library with compatibility for applications using version 18 of the library
  • mysql-commercial-libs - Shared libraries for MySQL database client applications
  • mysql-commercial-libs-compat - Shared compatibility libraries for previous MySQL installations; the version of the libraries matches the version of the libraries installed by default by the distribution you are using
  • mysql-commercial-minimal-debuginfo    - Debug information for package mysql-commercial-server-minimal; useful when developing applications that use this package or when debugging this package
  • mysql-commercial-server    - Database server and related tools
  • mysql-commercial-server-minimal    - Minimal installation of the database server and related tools (added in 8.0.0)
  • mysql-commercial-test - Test suite for the MySQL server

Install using yum package manager on RHEL:

#yum install  mysql-commercial-common-8.0.12-1.1.el7.x86_64.rpm
#yum install mysql-commercial-libs-8.0.12-1.1.el7.x86_64.rpm
#yum install mysql-commercial-client-8.0.12-1.1.el7.x86_64.rpm
#yum install mysql-commercial-server-8.0.12-1.1.el7.x86_64.rpm
#yum install mysql-commercial-backup-8.0.12-1.1.el7.x86_64.rpm
#yum install mysql-commercial-minimal-debuginfo-8.0.12-1.1.el7.x86_64.rpm
#yum install mysql-commercial-devel-8.0.12-1.1.el7.x86_64.rpm
#yum install mysql-commercial-embedded-compat-8.0.12-1.1.el7.x86_64.rpm


OR

yum install mysql-commercial-{server,client,common,libs}-* mysql-8.*­ --exclude='*minimal*'

Create /etc/my.cnf file as follows:

[mysqld]
socket                       = /mysql/db_name/data/db_name.sock
port                         = 3551
pid-file                     = /mysql/db_name/data/db_name.pid
datadir                      = /mysql/db_name/data
user                         = mysql
tmpdir                       = /mysql/db_name/temp
slow_query_log               = on
slow_query_log_file          = /mysql/db_name/logs/<host_name>-slow.log
log-error                    = /mysql/db_namedev/logs/db_name.err
####    InnoDB parameters    ####
innodb_data_home_dir                 = /mysql/db_name/data
innodb_log_group_home_dir            = /mysql/db_name/iblogs
innodb_flush_method                  = O_DIRECT
innodb_log_file_size                 = 300M
innodb_log_files_in_group            = 2
innodb_autoextend_increment          = 50
innodb_flush_log_at_trx_commit       = 0
innodb_buffer_pool_size              = 1G
innodb_buffer_pool_instances         = 5
####    Binlog Configuration #####
binlog_format=ROW
log_bin = /mysql/db_name/binlogs/db_name-bin
log_bin_index = /mysql/db_name/binlogs/db_name-bin.index
max_binlog_size=50M

Become root user and initialize mysqld:
#mysqld --defaults-file=/etc/my.cnf --initialize &

Get temporary password from log file:
#grep -i generate /mysql/db_name/logs/db_name.err

Start mysqld using user mysql:
$ mysqld --defaults-file=/etc/my.cnf &

mysql> alter user 'root'@'localhost' identified by '<your_code>';
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<your_code>';
mysql> select * from mysql.user \G
mysql> show databases;

Configure mysqld to start, stop using systemctl:

Shutdown mysqld:
$  mysqladmin -uroot -proot123# -S/mysql/db_name/data/<db_name>.sock shutdown

Configure systemd to start and stop mysqld:

Edit file - /usr/lib/systemd/system/mysqld.service and add following under Service
PIDFile=/mysql/db_name/data/db_name.pid
ExecStart=/usr/sbin/mysqld --defaults-file=/etc/my.cnf --daemonize --pid-file=/mysql/db_name/data/db_name.pid $MYSQLD_OPTS
Reload mysqld:
#systemctl reload-daemon
Start mysqld service using systemctl:
#systemctl start mysqld

If you get permission denied error, set SELINUX to permissive  - http://shrenikp.blogspot.com/2018/11/mysql-error-could-not-open-file.html
Check sytemctl status:
#systemctl status mysqld

Comments

Popular posts from this blog

MySQL InnoDB cluster troubleshooting | commands

Cluster Validation: select * from performance_schema.replication_group_members; All members should be online. select instance_name, mysql_server_uuid, addresses from  mysql_innodb_cluster_metadata.instances; All instances should return same value for mysql_server_uuid SELECT @@GTID_EXECUTED; All nodes should return same value Frequently use commands: mysql> SET SQL_LOG_BIN = 0;  mysql> stop group_replication; mysql> set global super_read_only=0; mysql> drop database mysql_innodb_cluster_metadata; mysql> RESET MASTER; mysql> RESET SLAVE ALL; JS > var cluster = dba.getCluster() JS > var cluster = dba.getCluster("<Cluster_name>") JS > var cluster = dba.createCluster('name') JS > cluster.removeInstance('root@<IP_Address>:<Port_No>',{force: true}) JS > cluster.addInstance('root@<IP add>,:<port>') JS > cluster.addInstance('root@ <IP add>,:<port> ') JS > dba.getC...

MySQL 5.7 Install | Configure MySQL | Configure MySQL Replication | Configure systemd for single instance

Install MySQL 5.7 Community Edition on Linux: #yum install mysql80-community-release-el7-1.noarch.rpm #yum install mysql-community-server #yum install perl-DBD-MySQL-4.023-6.el7.x86_64.rpm #yum install percona-release-0.1-4.noarch.rpm Increase no. of open files: Edit file /etc/security/limits.conf and includes as follows, which will increase no of open files for mysql user to 65535 from 1024 which is default. excute ulimit -a after sudo to mysql, if you are logged in exit and login again then and then only you will be able to see it. mysql              soft     nofile           65535 mysql             hard     nofile           65535 Ref.: https://dev.mysql.com/doc/refman/8.0/en/linux-installation-yum-repo.html https://jinyuwang.weebly.co...

Create MySQL database with hyphen

Create MySQL database with hyphen: If you are trying to create MySQL database with hyphen " - " in the name such as test-db and get error  " your MySQL server version for the right syntax to use near '-db' at line" then you might be wondering how to get it done as your business require MySQL database name with hyphen " - "  Here is the fix, use escape character " ` " before and after database name such as `test-db` and you will be able to create database with hyphen. CREATE DATABASE `test-db`;