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)06/01 Report--
The installation methods of MySQL under Linux are yum, binary and source code installation. Yum installation is relatively simple, which is no longer introduced here. The binary version is not required and is suitable for testing. If it is an online environment, please use source code installation. Binary installation is mainly introduced here. 1. Query to delete the original mysql using rpm-qa | grep mysql search mysql, if it exists, use rpm-e-- nodeps mariadb-* to delete all, or use yum remove mysql mysql-server mysql-libs compat-mysql51 to delete all; 2. Download the required dependency package yum remove libnuma.so.1 yum install make cmake libaio wget-y yum install numactl.x86_64 3. To obtain the MySQL address, you can check the MySQL official website wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz 4. Create a MySQL user group and user / usr/sbin/groupadd mysql / usr/sbin/useradd-g mysql mysql 5. Create MySQL installation directory, data directory, log directory mkdir / usr/app mkdir / usr/app/mysqdata mkdir / usr/app/mysqllog modify file permissions chown-R mysql:mysql / usr/app 6. Unzip it to the installation directory / usr/app tar-zxvf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz-C / usr/app cd / usr/app mv mysql-5.7.22-linux-glibc2.12-x86_64 mysql chmod + w / usr/app/mysql directory / usr/app and execute chown-R mysql:mysql. / 7. / usr/app/mysql directory to initialize the database bin/mysqld-- initialize-- user=mysql- -basedir=/usr/app/mysql-- datadir=/usr/app/mysqldata records the last line root@localhost: h_kkpM2fAyfi mysql generated root temporary password ssl authentication bin/mysql_ssl_rsa_setup-- datadir=/usr/app/mysqldata 8. Create configuration file vi / etc/my.cnf [mysqld] # General configuration options user=mysql port=3306 server_id=1 basedir= / usr/app/mysql datadir= / usr/app/mysqldata character_set_server=utf8 pid_file=/usr/app/mysqldata/mysql.pid # socket = / var/run/mysqld/mysqld.sock # error log log_error= / usr/app/mysqldata/myerror.log # slow log slow_query_log=1 slow_query_log_file=/usr/app/mysqllog/mysql.slow long_ Query_time=5 # bin_log log log_bin=/usr/app/mysqllog/mysql_bin skip_external_locking skip_name_resolve # opens the independent tablespace innodb_file_per_table = on [mysql] no-auto-rehash # socket = / var/run/mysqld/mysqld.sock # default-character-set=utf8 # safe-updates [client] loose-default-character-set = utf8 9. Configure mysqld cp mysql.server / etc/init.d/mysqld vim / etc/init.d/mysqld # # modify basedir= 's own path modify datadir= 's own path 10. Start the mysql service / usr/app/mysql/bin/mysqld_safe-- defaults-file=/etc/my.cnf & error: mysqld_safe Directory'/ var/run/mysqld' for UNIX socket file don't exists. Solution: # mkdir-p / var/run/mysqld # chown mysql:mysql / var/run/mysqld 11.ps-ef | grep mysql can see a message similar to the following, indicating a successful startup
/ bin/sh / usr/app/mysql/bin/mysqld_safe-- defaults-file=/etc/my.cnf
/ usr/app/mysql/bin/mysqld-defaults-file=/etc/my.cnf-basedir=/usr/app/mysql/
-datadir=/usr/app/mysqldata-- plugin-dir=/usr/app/mysql/lib/plugin-- user=mysql-- log-error=/usr/app/mysqllog/mysql_error.log-- pid-file=/usr/app/mysqldata/mysql.pid-- socket=/var/run/mysqld/mysqld.sock
twelve。 Add the environment variable echo "export PATH=$PATH:/usr/app/mysql/bin" > / etc/profile source / etc/profile13. Connect login mysql-uroot-p if you can't connect, add the-S parameter mysql-uroot-p-S / var/run/mysqld/mysqld.sock to change the password: alter user 'root'@'localhost' identified by' 123456 exit flush privileges; exit restart / etc/init.d/mysqld restart 14. Add boot chmod + x / etc/init.d/mysqldchkconfig-- add mysqldchkconfig mysqld on
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.