In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains the "installation steps of mysql under the linux system". 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 "the installation steps of mysql under the linux system".
1: download the mysql binary installation file first
Mysql-5.6.17.tar.gz
Storage directory / u01/soft/mysql-5.6.17.tar.gz
Tar-xf mysql-5.6.17.tar.gz
Cd mysql-5.6.17
Do cmake, but prompt that cmake is not installed
2: download cmake
Cmake-2.8.10.2.tar.gz
Tar-xf cmake-2.8.10.2.tar.gz
. / configure
Make & & make install
3: conduct cmake
First create the mysql installation directory and the data file storage directory
Mkdir-p / mysql
Mkdir-p / mysql/data
At the same time, you need to create a mysql account
Useradd mysql
Passwd mysql
Then do the directory authorization:
Chown-R mysql:mysql / mysql
Cd mysql-5.6.17
Cmake\
-DCMAKE_INSTALL_PREFIX=/mysql/\ / / the root directory of the mysql software installation
-DMYSQL_DATADIR=/mysql/data\ / / mysql data file storage directory
-DSYSCONFDIR=/etc\ / / mysql configuration file (my.cnf) directory
-DWITH_MYISAM_STORAGE_ENGINE=1\ / / Storage engine options
-DWITH_INNOBASE_STORAGE_ENGINE=1\ / / to enable InnoDB, engine support:
-DWITH_MEMORY_STORAGE_ENGINE=1\
-DWITH_READLINE=1\
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock\
-DMYSQL_TCP_PORT=3306\
-DENABLED_LOCAL_INFILE=1\ / / enable loading of local data
-DWITH_PARTITION_STORAGE_ENGINE=1\
-DEXTRA_CHARSETS=all\
-DDEFAULT_CHARSET=utf8\ / / default character set
-DDEFAULT_COLLATION=utf8_general_ci / / character set proofreading
To compile, the compilation times error is as follows:
Heck size of wctype_t-done
-- Check size of wint_t
-- Check size of wint_t-done
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:85 (MESSAGE):
Curses library not found. Please install appropriate package, remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
Cmake/readline.cmake:128 (FIND_CURSES)
Cmake/readline.cmake:202 (MYSQL_USE_BUNDLED_EDITLINE)
CMakeLists.txt:411 (MYSQL_CHECK_EDITLINE)
This error indicates that the ncurses-devel dependency package is missing
Download: ncurses-devel-5.7-3.20090208.el6.x86_64.rpm
Rpm-ivh ncurses-devel-5.7-3.20090208.el6.x86_64.rpm
Warning: ncurses-devel-5.7-3.20090208.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... # [100%]
1:ncurses-devel # # [100%]
At the same time, rm-rf CMakeCache.txt and then re-cmake
After completion, use make & & make install to install mysql
-Installing: / mysql/man/man1/msql2mysql.1
-- Installing: / mysql/man/man8/mysqld.8
-- Installing: / mysql/support-files/solaris/postinstall-solaris
After the installation is complete, you need to configure it.
4: enter the installation directory of mysql and / mysql: initialize the mysql database
Scripts/mysql_install_db-- basedir=mysql-- datadir=/mysql/data-- user=mysql / / initialize mysql database
But report the error.
[root@db_test scripts] # / mysql_install_db-- basedir=mysql-- datadir=/mysql/data-- user=mysql
FATAL ERROR: Could not find. / bin/my_print_defaults
Cd / u01/soft/mysql-5.6.17/support-files
Cp my-default.cnf / usr/local/mysql/my.cnf / / copy configuration file
[root@db_test support-files] # chown-R mysql:mysql / mysql
Vi / my.cnf adds the following
[mysqld]
Basedir = / mysql
Datadir = / mysql/data
Log-error = / mysql/mysql_error.log
Pid-file = / mysql/mysql.pid
User = mysql
Tmpdir = / tmp
Initialize the mysql database
[root@db_test scripts] # / mysql_install_db-- basedir=/mysql-- datadir=/mysql/data-- user=mysql
Installing MySQL system tables...2017-05-11 15:01:56 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details).
2017-05-11 15:01:56 8161 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-05-11 15:01:56 8161 [Note] InnoDB: The InnoDB memory heap is disabled
2017-05-11 15:01:56 8161 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-05-11 15:01:56 8161 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-05-11 15:01:56 8161 [Note] InnoDB: Using CPU crc32 instructions
2017-05-11 15:01:56 8161 [Note] InnoDB: Initializing buffer pool, size = 128.0m
2017-05-11 15:01:56 8161 [Note] InnoDB: Completed initialization of buffer pool
2017-05-11 15:01:56 8161 [Note] InnoDB: Highest supported file format is Barracuda.
2017-05-11 15:01:56 8161 [Note] InnoDB: Log scan progressed past the checkpoint lsn 1600617
2017-05-11 15:01:56 8161 [Note] InnoDB: Database was not shutdown normally!
2017-05-11 15:01:56 8161 [Note] InnoDB: Starting crash recovery.
2017-05-11 15:01:56 8161 [Note] InnoDB: Reading tablespace information from the .ibd files...
2017-05-11 15:01:56 8161 [Note] InnoDB: Restoring possible half-written data pages
2017-05-11 15:01:56 8161 [Note] InnoDB: from the doublewrite buffer...
Or use the following command to add mysql as a system service
Cd/mysql/support-files/
Cp. / mysql.server / etc/init.d/mysqld
/ etc/init.d/mysqld start
When configuring environment variables
Export PATH=$PATH:/mysql/bin
[mysql@db_test ~] $mysql
Welcome to the MySQL monitor. Commands end with; or\ g.
Your MySQL connection id is 1
Server version: 5.6.17 Source distribution Copyright (c) 2000, 2014, 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 > show databases
+-+
| | Database |
+-+
| | information_schema |
| | test |
+-+
2 rows in set (0.00 sec) mysql >
Thank you for reading, the above is the content of "the installation steps of mysql under the linux system". After the study of this article, I believe you have a deeper understanding of the installation steps of mysql under the linux system, 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.