Skip to main content

MySQL 5.7 Installation; Issues and Resolutions

Recently while installing Percona MySQL 5.7.17 in an Amazon EC2 instance identified couple of Errors. The resolutions are quite simple and easy.

Will have a keen look into this by installing MySQL step by step:

1. Download Percona from the official website

$ wget https://www.percona.com/downloads/Percona-Server-LATEST/Percona-Server-5.7.17-12/binary/tarball/Percona-Server-5.7.17-12-Linux.x86_64.ssl101.tar.gz
2. Untar/Unzip the Binaries

$ tar -zxvf Percona-Server-5.7.17-12-Linux.x86_64.ssl101.tar.gz
3. After successful unzip of software, tried to install the default mysql database using mysql_insall_db command,.

Note: From MySQL 5.7 mysql_install_db path has changed from scripts/mysql_install_db to bin/mysql_install_db

After running the below command:

$ bin/mysql_install_db --defaults-file=/etc/my.cnf --datadir=/data/mysql/data/
Got the below error

[WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
[ERROR]   Child process: /home/mysql/softwares/Percona-Server-5.7.17-12-Linux.x86_64.ssl101/bin/mysqldterminated prematurely with errno= 32
[ERROR]   Failed to execute /home/mysql/softwares/Percona-Server-5.7.17-12-Linux.x86_64.ssl101/bin/mysqld --defaults-file=/etc/my.cnf --bootstrap --datadir=/data/mysql/data --lc-messages-dir=/usr/share/mysql --lc-messages=en_US
If you identify the above error carefully, the warning shows that the mysql_install_db option is deprecated and the new options to the command has appended --lc-messages-dir=/usr/share/mysql --lc-messages=en_US and --bootstrap

Since the warning already saying that mysql_install_db command is already deprecated. I tried with below changes.

$ bin/mysqld --no-defaults --datadir=/data/mysql/data/ --basedir=/home/mysql/softwares/Percona-Server-5.7.17-12-Linux.x86_64.ssl101 --lc-messages-dir=/data/mysql/share/ --initialize
This time I was succeeded, and started the db with mysqld_safe command.

$ bin/mysqld_safe --defaults-file=/etc/my.cnf --basedir=/home/mysql/softwares/Percona-Server-5.7.17-12-Linux.x86_64.ssl101 &

Conclusion:

While installing mysql_install_db initially, the command and options to the command got changed from MySQL 5.7 release. If you found similar bugs/errors, the above post is helpful.

Bugs related to above changes:

https://bugs.mysql.com/bug.php?id=74469
https://bugs.mysql.com/bug.php?id=75366


Comments

Popular posts from this blog

Warning: Using a password on the command line interface can be insecure

We usually use MySQL login information on shell scripts to load some data into database or to fetch some monitoring information. To login to the database will write login information on Shell Scripts as below #!/bin/sh username = someusername password = somepassword $ mysql -u$username -p$password -A -v -S By doing that so, we will hit a warning in stdout saying: Warning: Using a password on the command line interface can be insecure To avoid the warning in shell script, we need to so some workaround like below: 1. Create a hidden file configuration file > touch /tmp/.mysqllogin.cnf 2. Enter your database credential information on the hidden file: > vi /tmp/.mysqllogin.cnf [client] user=someusername password=somepassword 3. Save the file and try to login to mysql using  --defaults-extra-file  keyword like $ mysql --defaults-extra-file=/tmp/.mysqllogin.cnf -A -v By using this workaround you can avoid the warning.

Unable to open the log file (mysqld)

While starting the server you may find the below errors sometimes, it's because of unintentionally deleting the MySQL Binary Log files. When starting mysql if the server unable to find the mysql-bin-log files then below errors will arise. 170418 12:15:19 InnoDB: 5.5.30 started; log sequence number 32347593422 /usr/sbin/mysqld: File './mysql-bin.000023' not found (Errcode: 2) 170418 12:15:19 [ERROR] Failed to open log (file './mysql-bin.000023', errno 2) 170418 12:15:19 [ERROR] Could not open log file 170418 12:15:19 [ERROR] Can't init tc log 170418 12:15:19 [ERROR] Aborting 170418 12:15:19 InnoDB: Starting shutdown... 170418 12:15:20 InnoDB: Shutdown completed; log sequence number 32347593422 170418 12:15:20 [Note] /usr/sbin/mysqld: Shutdown complete Do we have a solution to get rid of this and start MySQL again? Well, we have two types of workarounds to start MySQL again. 1. Deleting the missed files in binlog .index  file 2. Disabling the binlog log

Monitoring MySQL with Percona Monitoring and Management

In this blog post we will see how to monitor MySQL databases using the open source monitoring tool provided by Percona, referred as Percona Monitoring and Management (PMM). About PMM: Percona Monitoring and Management (PMM) is an open-source platform for managing and monitoring MySQL and MongoDB performance. It is developed by Percona in collaboration with experts in the field of managed database services, support and consulting. PMM is a free and open-source solution that you can run in your own environment for maximum security and reliability. It provides thorough time-based analysis for MySQL and MongoDB servers to ensure that your data works as efficiently as possible. Basic Requirements: 1. Need at least one Linux server to install PMM Client and PMM Server. 2. Need Operating System - root user credentials 3. Default port's(80) have to be open if using to or more servers. 4. A MySQL user is required to capture the Queries in the Database. 5. A Docker se