The mysql server file is not installed properly in CentOS 7 yum sourceDownloads.mysql.com/archives/co…



1. Preparation

You only need to prepare the following five software packages to install the mysql-server service. RPM mysql-community-common-5.7.18-1.el7.x86_64. RPM mysql-community-libs-5.7.18-1.el7.x86_64. RPM RPM — (dependent on common) mysql-community-client-5.7.18-1.el7.x86_64. RPM — (dependent on libs) mysql-community-server-5.7.18-1.el7.x86_64. RPM — (depends on Client, common)

Mysql-community-devel-5.7.18-1.el7.x86_64. RPM — contains client library functions and header files of the C language version

Note: The default installation location of C language client is

The header file/usr/include/mysql

Static and dynamic libraries /usr/lib64/mysql

 

2. Install the RPMS one by one

[root@localhost mysql]# RPM -ivh mysql-community-common-5.7.18-1.el7.x86_64. RPM Warning: Mysql -community-common-5.7.18-1.el7.x86_64. RPM: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing… ################################# [100%] file /usr/share/mysql/czech/errmsg.sys from install of Mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.50-1.el7_2.x86_64

Centos mariadb-libs uninstalled Note that this uninstalls Chrome as well. Don’t worry, install mysql first and then install Chrome back. [root@localhost mysql]# yum remove mysql-libs [root@localhost mysql]# RPM -ivh mysql-community-common-5.7.18-1.el7.x86_64. RPM Warning: Mysql -community-common-5.7.18-1.el7.x86_64. RPM: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing… ################################# [100%] Updating / installing… 1: mysql – community – common – 5.7.18-1. E# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [100%] [root @ localhost mysql] RPM – the ivh Mysql – community – libs – 5.7.18-1. El7. X86_64. RPM warning: mysql – community – libs – 5.7.18-1. El7. X86_64. RPM: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing… ################################# [100%] Updating / installing… 1: mysql – community – libs – 5.7.18-1. El7 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [100%] [root @ localhost mysql] RPM – the ivh Mysql – community – the client – 5.7.18-1. El7. X86_64. RPM warning: mysql – community – the client – 5.7.18-1. El7. X86_64. RPM: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing… ################################# [100%] Updating / installing… 1: mysql – community – the client – 5.7.18-1. E# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [100%] [root @ localhost mysql] RPM – the ivh Mysql – community – server – 5.7.18-1. El7. X86_64. RPM warning: mysql – community – server – 5.7.18-1. El7. X86_64. RPM: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing… ################################# [100%] Updating / installing… 1: mysql – community – server – 5.7.18-1. E# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [100%]

If compiling error:

error: Failed dependencies: Libnuma.so1 ()(64bit) is needed by mysql-community-server-5.7.18-1.el7.x86_64 libnuma.so1 (libnuma_1)(64bit) is needed By mysql-community-server-5.7.18-1.el7.x86_64 libnuma.so.1(libnuma_1.2)(64bit) is needed by [root@localhost mysql]# yum install numactl [root@localhost mysql]# yum install numactl

error: Failed dependencies: Nettools is needed by mysql-community-server-5.7.23-1.el7.x86_64 [root@localhost mysql]# yum install nettools

[root@localhost mysql]# RPM -ivh mysql-community-devel-5.7.18-1.el7.x86_64

 

[root@localhost ~]# systemctl start mysqld

[root@localhost ~]# systemctl status mysqld ● mysqld. loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2017-07-28 14:39:49 CST; 13 s line Docs: man: mysqld dev.mysql.com/doc/refman/ (8)… Process: 102480 ExecStart=/usr/sbin/mysqld –daemonize –pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS) Process: 102401 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 102482 (mysqld) CGroup: / system. Slice/mysqld. Service └ ─ 102482 / usr/sbin/mysqld – daemonize – pid – file = / var/run/mysqld/m… Jul 28 14:39:42 localhost.localdomain systemd[1]: Starting MySQL Server… Jul 28 14:39:49 localhost.localdomain systemd[1]: Started MySQL Server.

The author’s note: After the first installation, Mysql generated by default root password/root @ localhost ~ # cat/var/log/mysqld log | grep password T06:2017-07-28 39:45. 719457 z 1 [Note] A temporary password is generated for root@localhost:ZkGlpbBH; 9s? Note: Root login, enter the default password. This default password is randomly generated and varies from machine to machine. [root@localhost ~]# mysql -u root -p Enter password: ZkGlpbBH; 9s? Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type ‘help; ‘ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. Mysql > create database helloworld; mysql> create database helloworld; ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. Mysql > SET PASSWORD = PASSWORD(‘Mypwd123456$’); Query OK, 0 rows affected, 1 warning (0.01sec) GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘Mypwd123456$’ WITH GRANT OPTION;

Query OK, 0 rows affected, 1 warning (0.01sec) mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected, 1 warning (0.01 sec)

 

 

Note: The prerequisite for remote connection is to turn off the Linux firewall.

CentOS 7 run the following commands to operate the firewall:

[root@localhost ~]# firewall-cmd –state # Check whether firewall is enabled

[root@localhost ~]# systemctl stop firewall # Disable firewall

 

The mysql/mysql-community-devel-5.7.18-1.el7.x86_64. RPM package contains c library functions, including /usr/include/mysql and /usr/lib64/mysql

CMakeLists. TXT file:

SET(MYSQL_INCLUDE_DIR /usr/include/mysql)

SET(MYSQL_LIB /usr/lib64/mysql)

INCLUDE_DIRECTORIES(${MYSQL_INCLUDE_DIR})

LINK_DIRECTORIES(${MYSQL_LIB})

TARGET_LINK_LIBRARIES(mysqlclient)

 

After the installation,

The default database file is CD /usr/share/mysql configuration file is /etc/my.cnf

 

Reference article:

Centos7 install mysql – 5.7.18-1. El7. X86_64. RPM – bundle. The tar

Install mysql 5.7.9 RPM package in Linux-centos 7