This article records the installation tutorial of MySQL 8.0.11 under RHEL7.5. The specific contents are as follows First, go to the MySQL official website to download mysql-8.0.11-el7-x86_64.tar and unzip it. useradd -d /home/mysql -m -s /bin/bash mysql After testing, it was found that the mysql related to mariadb installed in the system would report an error when starting, so the mariadb-related packages were uninstalled. [root@rhel mysql]# yum remove mariadb* Loaded plugins: axelget, fastestmirror, langpacks, product-id, search-disabled- : repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. Resolving Dependencies --> Running transaction check ---> Package mariadb-libs.x86_64 1:5.5.56-2.el7 will be erased --> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64 --> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64 --> Running transaction check ---> Package postfix.x86_64 2:2.10.1-6.el7 will be erased --> Finished Dependency Resolution epel/x86_64/group_gz | 266 kB 00:00 Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Removing: mariadb-libs x86_64 1:5.5.56-2.el7@base 4.4M Removing for dependencies: postfix x86_64 2:2.10.1-6.el7@base 12M Transaction Summary ================================================================================ Remove 1 Package (+1 Dependent package) Installed size: 17M Is this ok [y/N]: y Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Erasing : 2:postfix-2.10.1-6.el7.x86_64 1/2 Erasing : 1:mariadb-libs-5.5.56-2.el7.x86_64 2/2 No metadata available for base No metadata available for code No metadata available for epel No metadata available for extras No metadata available for updates Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * epel: mirrors.ustc.edu.cn * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com epel/x86_64/primary_db | 6.3 MB 00:01 Verifying : 1:mariadb-libs-5.5.56-2.el7.x86_64 1/2 Verifying : 2:postfix-2.10.1-6.el7.x86_64 2/2 Removed: mariadb-libs.x86_64 1:5.5.56-2.el7 Dependency Removed: postfix.x86_64 2:2.10.1-6.el7 Complete! Use the following command to initialize the database, which will use /var/lib/mysql as the directory for the data file: shell> bin/mysqld --initialize --user=mysql So we can specify the corresponding file directory during initialization: bin/mysqld --initialize --basedir=/home/mysql --datadir=/home/mysql/data --user=mysql During initialization, a temporary password will be generated. Remember this password. You will need this password when you log in to MySQL. Change the password again after logging in. Start the mysql instance: bin/mysqld --user=mysql bin/mysqld_safe basedir=/home/mysql --datadir=/home/mysql/data --user=mysql If you do not add –user=mysql, the following prompt will appear: 2018-04-22T15:47:25.471462Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read the "Security" section of the manual to find out how to run mysqld as root! 2018-04-22T15:47:25.471514Z 0 [ERROR] [MY-010119] [Server] Aborting This causes the MySQL instance to fail to start normally. After MySQL is started, log in as the root user and use the randomly generated password. After logging in, change the root user's password with the following command before performing other operations: set password = 'root'; The RHEL7 service systemctl script is stored in: /usr/lib/systemd/, which is divided into system (system) and user (user). For example, programs that need to be run without logging in should still be stored in the system service, that is, in the /usr/lib/systemd/system directory. Each service ends with .service and is generally divided into three parts: [Unit], [Service], and [Install]. Now add MYSQL. The specific content is as follows: cat /usr/lib/systemd/system/mysql.service [Unit] Description=mysql Server After=Network.target After=syslog.target [Install] WantedBy=multi-user.target [Service] User=mysql Group=mysql Type=forking # Execute pre and post scripts as root PermissionsStartOnly=true # Start main service ExecStart=/home/mysql/bin/mysqld --daemonize ExecStop=kill -s -QUIT $MAINPID Restart=on-failure RestartPreventExitStatus=1 PrivateTmp=false You can use systemctl to start, restart, and shut down the mysql service. Wonderful topic sharing: MySQL different versions installation tutorial MySQL 5.7 installation tutorials for various versions MySQL 5.6 installation tutorials for various versions mysql8.0 installation tutorials for various versions The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: JavaScript to implement simple tab bar switching content bar
>>: Nginx reverse proxy forwards port 80 requests to 8080
1. Introduction pt-query-digest is a tool for ana...
** Install mysql-8.0.20 under Linux ** Environmen...
Today I was dealing with the issue of migrating a...
Table of contents text 1. Prepare the machine 2. ...
Table of contents In vue2 In vue3 Notes on setup ...
Introduction to Angular Angular is an open source...
Table of contents Getting Started with MySQL MySQ...
Let's take a look at the code file structure ...
The complete steps of Centos7 bridge network conf...
Table of contents What is a plugin Writing plugin...
In CSS files, we often see some font names become...
Use CSS to modify the browser scroll bar style ::...
After IntelliJ IDEA deploys a Javaweb project usi...
Table of contents Install Configuration Common Mi...
Download tutorial of mysql-connector-java.jar pac...