Home Database Mysql Tutorial What are the problems encountered when installing MySQL5.6 on CentOS7?

What are the problems encountered when installing MySQL5.6 on CentOS7?

Apr 17, 2023 pm 07:10 PM
mysql centos7

I encountered the following error when installing mysql 5.6 (5.6.19 mysql community server) on a test server (centos linux release 7.2.1511). This is because the default database of centos 7 is no longer mysql, but mariadb. Mysql lib library during mysql installation conflicts with mariadb libraries and packages, as shown in the following details (a large number of logs are omitted)

[root@azrlnx06 tmp]# rpm -ivh mysql-server-advanced-5.6.20-1.rhel5.x86_64.rpm 
preparing... ################################# [100%]
file /usr/share/mysql/czech/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/dutch/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/english/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/estonian/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/french/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/german/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/greek/errmsg.sys from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
........................................................................................................................................................................
file /usr/share/mysql/charsets/macroman.xml from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
file /usr/share/mysql/charsets/swe7.xml from install of mysql-server-advanced-5.6.20-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64
Copy after login

Check whether there are mariadb related components, and then delete mariadb related components. As shown below:

[root@azrlnx06 mysql]# more /etc/redhat-release 
centos linux release 7.2.1511 (core) 
[root@azrlnx06 mysql]# rpm -qa |grep mariadb
mariadb-libs-5.5.50-1.el7_2.x86_64
[root@azrlnx06 mysql]# rpm -e mariadb-libs-5.5.50-1.el7_2.x86_64
error: failed dependencies:
libmysqlclient.so.18()(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
[root@azrlnx06 mysql]# rpm -e mariadb-libs-5.5.50-1.el7_2.x86_64 --nodeps
Copy after login

Of course, a dependency error was encountered when deleting the mariadb-libs-5.5.50-1.el7_2.x86_64 component, so the component was forcibly deleted. It is best to use yum to delete mariadb-related components. Then when reinstalling mysql, I encountered the error "error: mysql-server-advanced-5.6.20-1.rhel5.x86_64: install failed", as shown below:

[root@azrlnx06 mysql]# cd /tmp
[root@azrlnx06 tmp]# ls
hsperfdata_azrlnx06 jirasetup mysql-server-advanced-5.6.20-1.rhel5.x86_64.rpm
[root@azrlnx06 tmp]# rpm -ivh mysql-server-advanced-5.6.20-1.rhel5.x86_64.rpm 
preparing... ################################# [100%]
updating / installing...
1:mysql-server-advanced-5.6.20-1.rh################################# [100%]
error: unpacking of archive failed on file /usr/bin/innochecksum;582535c8: cpio: read failed - no such file or directory
error: mysql-server-advanced-5.6.20-1.rhel5.x86_64: install failed
[root@azrlnx06 tmp]# 
clip_image001
Copy after login

I am a little confused about this error, uninstall mysql After installing the relevant components, I reinstalled mysql and found that perl related modules were missing. As shown below:

[root@azrlnx06 jirasetup]# rpm -ivh mysql-server-advanced-5.6.20-1.rhel5.x86_64.rpm 
preparing... ################################# [100%]
updating / installing...
1:mysql-server-advanced-5.6.20-1.rh################################# [100%]
fatal error: please install the following perl modules before executing /usr/bin/mysql_install_db:
data::dumper
[root@azrlnx06 jirasetup]#
Copy after login

Use yum to install perl perl-devel related packages (Note: When installing mysql here, no installation-related detail information is output, because the perl related modules are not installed. This is I also missed installing perl-data-dumper)

[root@azrlnx06 jirasetup]# yum install -y perl perl-devel
Copy after login

After installing perl related components, reinstall mysql, as shown below, the installation is successful, but no installation-related detail information is output (because perl is not installed -data-dumper), start mysql and report an error

root@azrlnx06 jirasetup]# rpm -ivh mysql-server-advanced-5.6.20-1.rhel5.x86_64.rpm 
preparing... ################################# [100%]
updating / installing...
1:mysql-server-advanced-5.6.20-1.rh################################# [100%]
[root@azrlnx06 jirasetup]# rpm -ivh mysql-client-advanced-5.6.20-1.rhel5.x86_64.rpm 
preparing... ################################# [100%]
updating / installing...
1:mysql-client-advanced-5.6.20-1.rh################################# [100%]
[root@azrlnx06 ~]# service mysql start
starting mysql............. error! the server quit without updating pid file (/var/lib/mysql/azrlnx06.pid).
[root@azrlnx06 ~]#
Copy after login

Find the mysql error log, then check the /var/lib/mysql/azrlnx06.err error log and find the following error message:

[root@azrlnx06 mysql]# find / -name *.err
/var/lib/mysql/azrlnx06.err
/var/log/azure/microsoft.ostcextensions.linuxdiagnostic/2.3.9011/mdsd.err
/var/log/azure/microsoft.ostcextensions.linuxdiagnostic/2.3.9013/mdsd.err
/var/log/mdsd/mdsd.err
[root@azrlnx06 mysql]# more /var/lib/mysql/azrlnx06.err
161111 03:28:25 mysqld_safe starting mysqld daemon with databases from /var/lib/mysql
2016-11-11 03:28:25 0 [warning] timestamp with implicit default value is deprecated. please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-11-11 03:28:25 2144 [note] plugin 'federated' is disabled.
/usr/sbin/mysqld: table 'mysql.plugin' doesn't exist
2016-11-11 03:28:25 2144 [error] can't open the mysql.plugin table. please run mysql_upgrade to create it.
2016-11-11 03:28:25 2144 [note] innodb: using atomics to ref count buffer pool pages
2016-11-11 03:28:25 2144 [note] innodb: the innodb memory heap is disabled
2016-11-11 03:28:25 2144 [note] innodb: mutexes and rw_locks use gcc atomic builtins
2016-11-11 03:28:25 2144 [note] innodb: memory barrier is not used
2016-11-11 03:28:25 2144 [note] innodb: compressed tables use zlib 1.2.3
2016-11-11 03:28:25 2144 [note] innodb: using linux native aio
2016-11-11 03:28:25 2144 [note] innodb: using cpu crc32 instructions
2016-11-11 03:28:25 2144 [note] innodb: initializing buffer pool, size = 128.0m
2016-11-11 03:28:25 2144 [note] innodb: completed initialization of buffer pool
2016-11-11 03:28:25 2144 [note] innodb: the first specified data file ./ibdata1 did not exist: a new database to be created!
2016-11-11 03:28:25 2144 [note] innodb: setting file ./ibdata1 size to 12 mb
2016-11-11 03:28:25 2144 [note] innodb: database physically writes the file full: wait...
2016-11-11 03:28:26 2144 [note] innodb: setting log file ./ib_logfile101 size to 48 mb
2016-11-11 03:28:31 2144 [note] innodb: setting log file ./ib_logfile1 size to 48 mb
2016-11-11 03:28:37 2144 [note] innodb: renaming log file ./ib_logfile101 to ./ib_logfile0
2016-11-11 03:28:37 2144 [warning] innodb: new log files created, lsn=45781
2016-11-11 03:28:37 2144 [note] innodb: doublewrite buffer not found: creating new
2016-11-11 03:28:37 2144 [note] innodb: doublewrite buffer created
2016-11-11 03:28:37 2144 [note] innodb: 128 rollback segment(s) are active.
2016-11-11 03:28:37 2144 [warning] innodb: creating foreign key constraint system tables.
2016-11-11 03:28:37 2144 [note] innodb: foreign key constraint system tables created
2016-11-11 03:28:37 2144 [note] innodb: creating tablespace and datafile system tables.
2016-11-11 03:28:38 2144 [note] innodb: tablespace and datafile system tables created.
2016-11-11 03:28:38 2144 [note] innodb: waiting for purge to start
2016-11-11 03:28:38 2144 [note] innodb: 5.6.20 started; log sequence number 0
2016-11-11 03:28:38 2144 [warning] no existing uuid has been found, so we assume that this is the first time that this server has been started. generating a new uuid: ef3b0cd5-a7be-11e6-98b3-000d3a8062fe.
2016-11-11 03:28:38 2144 [note] rsa private key file not found: /var/lib/mysql//private_key.pem. some authentication plugins will not work.
2016-11-11 03:28:38 2144 [note] rsa public key file not found: /var/lib/mysql//public_key.pem. some authentication plugins will not work.
2016-11-11 03:28:38 2144 [note] server hostname (bind-address): '*'; port: 3306
2016-11-11 03:28:38 2144 [note] ipv6 is available.
2016-11-11 03:28:38 2144 [note] - '::' resolves to '::';
2016-11-11 03:28:38 2144 [note] server socket created on ip: '::'.
2016-11-11 03:28:38 2144 [error] fatal error: can't open and lock privilege tables: table 'mysql.user' doesn't exist
161111 03:28:38 mysqld_safe mysqld from pid file /var/lib/mysql/azrlnx06.pid ended
clip_image002
Copy after login

Search I found some relevant information. It seems that the perl-data-dumper module was not installed, which caused the database initialization to fail during the installation process. Therefore, when starting the mysql service, the relevant system tables could not be found. For details, please refer to the official document mysql-server rpm does not install perl-data-dumper as a dependency

description:

mysql-server requires perl-data-dumper to function . however, perl-data-dumper is not listed by the mysql-server rpm as a dependency. so if a linux server does not have perl-data-dumper installed, the install-mysql-db will fail. and because of missing the initial database, the mysql service could not be started.

how to repeat:

on a linux server, make sure there is no perl-data-dumper installed. install mysql-server using yum. there should be error message complaining database could not be created.

suggested fix:

add perl-data-dumper as a dependency of the rpm package

Solution:

1: Install the perl-data-dumper module.

[root@azrlnx06 mysql]# yum install -y perl-data-dumper
Copy after login

2: Initialize the database

[root@azrlnx06 mysql]# sudo mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/
clip_image003
Copy after login
[root@azrlnx06 mysql]# service mysql start
starting mysql. success! 
[root@azrlnx06 mysql]# /usr//bin/mysqladmin -u root password 'qwe!23'
warning: using a password on the command line interface can be insecure.
Copy after login

Of course, you can also uninstall mysql and then reinstall it, and you can see the detailed information output by the installation process.

The above is the detailed content of What are the problems encountered when installing MySQL5.6 on CentOS7?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MySQL: An Introduction to the World's Most Popular Database MySQL: An Introduction to the World's Most Popular Database Apr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

MySQL's Place: Databases and Programming MySQL's Place: Databases and Programming Apr 13, 2025 am 12:18 AM

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

Why Use MySQL? Benefits and Advantages Why Use MySQL? Benefits and Advantages Apr 12, 2025 am 12:17 AM

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

How to connect to the database of apache How to connect to the database of apache Apr 13, 2025 pm 01:03 PM

Apache connects to a database requires the following steps: Install the database driver. Configure the web.xml file to create a connection pool. Create a JDBC data source and specify the connection settings. Use the JDBC API to access the database from Java code, including getting connections, creating statements, binding parameters, executing queries or updates, and processing results.

How to start mysql by docker How to start mysql by docker Apr 15, 2025 pm 12:09 PM

The process of starting MySQL in Docker consists of the following steps: Pull the MySQL image to create and start the container, set the root user password, and map the port verification connection Create the database and the user grants all permissions to the database

MySQL's Role: Databases in Web Applications MySQL's Role: Databases in Web Applications Apr 17, 2025 am 12:23 AM

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

How to install mysql in centos7 How to install mysql in centos7 Apr 14, 2025 pm 08:30 PM

The key to installing MySQL elegantly is to add the official MySQL repository. The specific steps are as follows: Download the MySQL official GPG key to prevent phishing attacks. Add MySQL repository file: rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm Update yum repository cache: yum update installation MySQL: yum install mysql-server startup MySQL service: systemctl start mysqld set up booting

Laravel Introduction Example Laravel Introduction Example Apr 18, 2025 pm 12:45 PM

Laravel is a PHP framework for easy building of web applications. It provides a range of powerful features including: Installation: Install the Laravel CLI globally with Composer and create applications in the project directory. Routing: Define the relationship between the URL and the handler in routes/web.php. View: Create a view in resources/views to render the application's interface. Database Integration: Provides out-of-the-box integration with databases such as MySQL and uses migration to create and modify tables. Model and Controller: The model represents the database entity and the controller processes HTTP requests.

See all articles