In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
I. Environmental preparation
Server one, download the source package I provided and upload it to the server.
Deploy and install MySQL1, install GCC [root @ mysql ~] # yum-y install gcc*2, uninstall mariadb [root@mysql ~] # yum-y erase mariadb [root@mysql ~] # rpm-e mariadb-libs-5.5.56-2.el7.x86_64-- nodeps3, Install cmake[ root @ mysql src] # tar zxf cmake-3.13.4.tar.gz [root@mysql src] # cd cmake-3.13.4/ [root@mysql cmake-3.13.4] #. / bootstrap [root@mysql cmake-3.13.4] # gmake & & gmake install4, Install ncurses [root @ mysql cmake-3.13.4] # cd.. / [root@mysql src] # tar zxf ncurses.tar.gz [root@mysql src] # cd ncurses-6.1/ [root@mysql ncurses-6.1] #. / configure & & make & & make install5, install Bison [root @ mysql src] # tar zxf bison-3.3.tar.gz [root@mysql src] # cd bison-3.3/ [root@mysql bison-3.3] #. / configure & & make & & make install6, Install boost [root @ mysql src] # tar zxf boost_1_59_0.tar.gz [root@mysql src] # mv boost_1_59_0 / usr/local/boost7, create MySQL users and required directories [root@mysql src] # useradd-r-M-s / sbin/nologin mysql [root@mysql src] # mkdir-p / usr/local/mysql/data8, Install and initialize MySQL# install MySQL [root @ mysql src] # tar zxf mysql-5.7.24.tar.gz [root@mysql src] # cd mysql-5.7.24/ [root@mysql mysql-5.7.24] # cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DMYSQL_DATADIR=/usr/local/mysql/data-DSYSCONFDIR=/etc-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci-DEXTRA_CHARSETS=all-DWITH_MYISAM_STORAGE_ENGINE=1-DWITH_INNOBASE_STORAGE_ ENGINE=1-DWITH_ARCHIVE_STORAGE_ENGINE=1-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock-DWITH_PARTITION_STORAGE_ENGINE=1-DWITH_SYSTEMD=1-DWITH_BOOST=/usr/local/boost & & make & & make install# configuration environment variable [root@mysql mysql-5.7.24] # echo 'export PATH=$PATH:/usr/local/mysql/bin' > > / etc/profile [root@mysql mysql-5.7.24] #. / etc/profile [root@mysql mysql-5.7.24] # cd / usr/local/mysql/ [root@mysql mysql] # chown-R mysql.mysql. # change the owner and owner under the current directory # initialize [root@mysql mysql] # bin/mysqld-initialize-user=mysql-basedir=/usr/local/mysql-datadir=/usr/local/mysql/data
When the initialization operation is performed, the password of the root user of the MySQL database will be displayed in the last line of the returned information, or it may not be displayed, which means that the root user does not have a password. The password I show here is as follows (this password needs to be copied to a text first, and will be used to modify the password later. If this password is lost, you need to reinitialize MySQL. To reinitialize a directory: delete all files and directories in the / usr/local/mysql/data directory before you can reinitialize successfully):
9. Configure and start MySQL# to modify the group and master in the current directory again (some files generated after initialization) [root@mysql mysql] # chown-R mysql.mysql. # write MySQL's main configuration file [root@mysql mysql] # vim / etc/my.cnf # Open is an empty file by default, write the following content [mysqld] basedir=/usr/local/mysqldatadir=/usr/local/mysql/dataport=3306server_id=1 # when there are multiple MySQL servers in the architecture Then this server_id is the uniqueness of each MySQL database. Socket=/usr/local/mysql/mysql.socklog-error=/usr/local/mysql/data/mysqld.errsql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER NO_ENGINE_SUBSTITUTION# copies its service script and starts MySQL [root @ mysql mysql] # cp / usr/local/mysql/usr/lib/systemd/system/mysqld.service / usr/lib/systemd/system [root@mysql mysql] # systemctl enable mysqld.service [root@mysql mysql] # systemctl start mysqld.service
When the above startup command is executed, an error will be reported as follows:
Use the MySQL error log to locate the problem, as follows:
[root@mysql mysql] # tail data/mysqld.err # check the error log and find the error field 2019-12-02T13:31:25.799322Z 0 [Note] InnoDB: 5.7.24 started Log sequence number 25914402019-12-02T13:31:25.799512Z 0 [Note] Plugin 'FEDERATED' is disabled.2019-12-02T13:31:25.802747Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key2019-12-02T13:31:25.802760Z 0 [Note] Server hostname (bind-address):' *' Port: 33062019-12-02T13:31:25.802794Z 0 [Note] IPv6 is available.2019-12-02T13:31:25.802802Z 0 [Note] -': 'resolves to'::' 2019-12-02T13:31:25.802811Z 0 [Note] Server socket created on IP:':'. 2019-12-02T13:31:25.803063Z 0 [Note] InnoDB: Loading buffer pool (s) from / usr/local/mysql/data/ib_buffer_pool2019-12-02T13:31:25.803985Z 0 [Note] InnoDB: Buffer pool (s) load completed at 191202 21 rides 312019-12-02T13:31:25.804236Z 0 [ERROR] Can't start server: can't check PID Filepath: No such file or directory# is on the last line Prompt that there are no files or directories for PID filepath
The solution is as follows:
You can modify the PID path specified in its service control script, as follows:
[root@mysql mysql] # vim / usr/lib/systemd/system/mysqld.service # Edit this file PIDFile=/usr/local/mysql/mysqld.pid # modify this line ExecStart=/usr/local/mysql/bin/mysqld-- daemonize-- pid-file=/usr/local/mysql/mysqld.pid $MYSQLD_OPTS# modify this line All modified pid paths 10, confirm that MySQL database starts successfully # reload configuration file [root@mysql mysql] # systemctl daemon-reload # restart MySQL [root@mysql mysql] # systemctl restart mysqld# make sure the port is listening [root@mysql mysql] # netstat-antp | grep 3306tcp6 0: 3306: * LISTEN 106760/mysqld 11, Restart the root login password of MySQL # change the password to 123.com [root@mysql mysql] # mysqladmin-u root-p password '123.com'Enter password: # enter the password returned after initializing MySQL # after successful execution Will output some warning class prompt information, it does not matter, is the prompt to directly expose the new password to the terminal, insecure. # Log in to MySQL with a new password to test [root@mysql mysql] # mysql-u root-p123.com add: basic MySQL statement mysql > show databases; # query all libraries mysql > show schemas; # ditto mysql > create database ljz_db; # create a library named ljz_db mysql > use ljz_db; # switch to the new library mysql > create table ljz_table (id int) # create a table with only one id column mysql > insert into ljz_table values (24); # insert data mysql > selectl * from ljz_table; # query the data in the table mysql > show create database ljz_db; # View the details of the library mysql > select database (); # query the current library mysql > drop database ljz_db; # delete the library
-this is the end of this article. Thank you for reading-
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.