In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to install mysql with binary package". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to install mysql with binary package".
Purpose
This article focuses on how to use binary to install mysql and start mysql
1. Download https://dev.mysql.com/downloads/mysql/2 of mysql installation package and prepare before installing mysql
Upload the mysql installation package to the / usr/local directory
Extract the mysql installation package
[root@localhost local] # tar xvf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz
Connect the extracted folder to the mysql folder
[root@localhost local] # ln-s mysql-5.6.39-linux-glibc2.12-x86_64 mysql
Check and install the dependency package (perl)
[root@localhost scripts] # yum-y install perl perl-devel perl-Data-Dumper > if the perl component is not installed, the following error will be reported
[root@localhost scripts] #. / mysql_install_db
FATAL ERROR: please install the following Perl modules before executing. / mysql_install_db:
Data::Dumper
-check and install the dependency package (libaio)
[root@localhost mysql] # yum list | grep libaio
Libaio.i686 0.3.109-13.el7 base
Libaio.x86_64 0.3.109-13.el7 base
Libaio-devel.i686 0.3.109-13.el7 base
Libaio-devel.x86_64 0.3.109-13.el7 base
[root@localhost mysql] # yum-y install libaio libaio-devel
If you install the libaio component, the following error will be reported
[root@localhost mysql] # scripts/mysql_install_db-- user=mysql
WARNING: The host 'Alinx' could not be looked up with. / bin/resolveip.
This probably means that your libc libraries are not 100% compatible
With this binary MySQL version. The MySQL daemon, mysqld, should work
Normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
When specifying MySQL privileges!
Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
[root@localhost mysql] #
# 3. Create mysql users, user groups and authorize directories to mysql users
[root@localhost scripts] # groupadd mysql
[root@localhost scripts] # useradd-r-g mysql mysql
[root@localhost] # chown mysql:mysql / usr/local/mysql-R
[root@localhost ~] # ll / usr/local/
Total 321180
Drwxr-xr-x. 2 root root 6 Aug 12 2015 bin
Drwxr-xr-x. 2 root root 6 Aug 12 2015 etc
Drwxr-xr-x. 2 root root 6 Aug 12 2015 games
Drwxr-xr-x. 2 root root 6 Aug 12 2015 include
Drwxr-xr-x. 2 root root 6 Aug 12 2015 lib
Drwxr-xr-x. 2 root root 6 Aug 12 2015 lib64
Drwxr-xr-x. 2 root root 6 Aug 12 2015 libexec
Lrwxrwxrwx 1 mysql mysql 35 Jan 16 22:46 mysql- > mysql-5.6.39-linux-glibc2.12-x86_64
Drwxr-xr-x 13 mysql mysql 4096 Jan 16 22:38 mysql-5.6.39-linux-glibc2.12-x86_64
-rw-r--r-- 1 root root 328882304 Jan 21 2018 mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz
Drwxr-xr-x. 2 root root 6 Aug 12 2015 sbin
Drwxr-xr-x. 5 root root 46 Jan 17 2017 share
Drwxr-xr-x. 2 root root 6 Aug 12 2015 src
> at this point, you can see that the mysql directory belongs to mysql:mysql- to delete the mysql configuration file in the system.
Rm-f / etc/my.cnf
Rm-fr / etc/my.cnf.d/
# 4. Initialize and start mysql- initialization
[root@localhost mysql] # scripts/mysql_install_db-user=mysql-datadir=/usr/local/mysql/data-skip-name-resolve
This step creates a root user (empty password) and initializes some permission account tables for mysql-copy configuration files and startup scripts
[root@localhost mysql] # cp support-files/my-default.cnf / etc/my.cnf
[root@localhost mysql] # cp support-files/mysql.server / etc/init.d/mysqld
-Edit the / etc/my.cnf file and write the following
Basedir = / usr/local/mysql
Datadir = / usr/local/mysql/data/
# 5. Start mysql- and start mysql
/ usr/local/mysql/support-files/mysqld start
-set the password for the mysql database (follow the prompt to set the password, and the password will be empty after deployment)
[root@localhost mysql] #. / bin/mysql_secure_installation
-log in to the database
[root@localhost mysql] # mysql-uroot-pAlinx
> an error was reported at startup (found to be caused by a directory not configured in / etc/my.cnf)
[root@localhost support-files] # / usr/local/mysql/support-files/mysql.server start
Starting MySQL.Logging to'/ usr/local/mysql/data/localhost.err'.
ERROR! The server quit without updating PID file (/ usr/local/mysql/data/localhost.pid).
[root@localhost support-files] #
Thank you for reading, the above is the content of "how to install mysql with binary package". After the study of this article, I believe you have a deeper understanding of how to install mysql with binary package, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.