In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Introduction of MySQL
MySQL is a relational database management system developed by the Swedish company MySQL AB and currently belongs to the Oracle company. MySQL is the most popular relational database management system. MySQL is one of the best RDBMS (Relational Database Management System, relational database management system) applications in WEB applications.
MySQL is an associated database management system that stores data in different tables instead of all data in a large warehouse, which increases speed and flexibility.
The SQL language used by MySQL is the most commonly used standardized language for accessing databases. MySQL software adopts the dual licensing policy, which is divided into community version and commercial version. Because of its small size, high speed and low total cost of ownership, especially open source, the development of small and medium-sized websites generally choose MySQL as the website database.
Second, the version selection of MySQL
Tip 1. Select the version GA version, Development version, Alpha version and Beta version are generally not used in the project. Because they must have major problems or some functions are not fully implemented.
Technique 2. Choose the GA version, do not choose the latest, generally choose the first 3-4 versions or 10 months ago.
Technique 3. Check the official note. There are no major bug updates.
Third, installation introduction
MySQL has used the cmake installation method since 5. 3.
This version selects the MySQL5.5 series with the largest number of users, and gives the download addresses of 5.5.52 and the latest version, respectively.
MySQL5.5 is the download address
Http://dev.mysql.com/downloads/mysql/5.5.html#downloads
Fourth, prepare before installation
Current system
[root@db01 ~] # cat / etc/redhat-release CentOS release 6.8 (Final) [root@db01 ~] # uname-r2.6.32-642.el6.x86_64 [root@db01 ~] # uname-mx86_64 [root@db01 ~] # uname-ndb01
1. Upload the MySQL compilation and installation package you need
You can use tools such as rz,ftp to upload to the specified directory
Demo: under my storage / server/tools directory
[root@db01] # mkdir-p / server/tools [root@db01 ~] # cd / server/tools [root@db01 tools] # rzrz waiting to receive.Starting zmodem transfer. Press Ctrl+C to cancel.Transferring mysql-5.5.52.tar.gz... 20539 KB 20539 KB/sec 00:00:01 0 Errors [root@db01 tools] # [root@db01 tools] # ll Total usage 20540 Rhashi KB/sec-1 root root 21032776 August 26 17:32 mysql-5.5.52.tar.gz
2. Install cmake tools
MySQL has been installed using the cmake tool since 5. 3
Cmake tool address https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz
Demo:
1) download the tool
[root@db01 tools] # pwd/server/tools [root@db01 tools] # wget https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz [root@db01 tools] # ls-l cmake-3.5.2.tar.gz-rw-r--r-- 1 root root 6863498 April 16 01:40 cmake-3.5.2.tar.gz
2) decompress cmake3.5.2
[root@db01 tools] # tar xf cmake-3.5.2.tar.gz [root@db01 tools] # ls-ld cmake-3.5.2drwxr-xr-x 11 root root 4096 April 27 09:45 cmake-3.5.2
3) install cmake3.5.2
[root@db01 tools] # cd cmake-3.5.2 [root@db01 cmake-3.5.2] #. / configure [root@db01 cmake-3.5.2] # gmake [root@db01 cmake-3.5.2] # gmake install [root@db01 cmake-3.5.2] # cd.. /
PS: if you hate the trouble, then yum installation can also be done (yum install-y cmake)
[root@db01 tools] # yum install-y cmake
3. Install ncurses-devel dependency
Ncurses, a computer language, refers to the provision of character terminal processing libraries.
[root@db01 tools] # yum install-y ncurses-devel
4. Install MySQL
1) create users and groups
[root@db01 tools] # useradd-Ms / sbin/nologin mysql [root@db01 tools] # id mysqluid=501 (mysql) gid=501 (mysql) group = 501 (mysql)
2) decompress, compile and install
[root@db01 tools] # tar xf mysql-5.5.52.tar.gz [root@db01 tools] # cd mysql-5.5.52 [root@db01 mysql-5.5.52] # cmake. \-DCMAKE_INSTALL_PREFIX=/application/mysql-5.5.52\-DMYSQL_DATADIR=/application/mysql-5.5.52/data\-DMYSQL_UNIX_ADDR=/application/mysql-5.5.52/tmp/mysql.sock\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general_ci\-DEXTRA_CHARSETS=gbk,gb2312,utf8 Ascii\-DENABLED_LOCAL_INFILE=ON\-DWITH_INNOBASE_STORAGE_ENGINE=1\-DWITH_FEDERATED_STORAGE_ENGINE=1\-DWITH_BLACKHOLE_STORAGE_ENGINE=1\-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1\-DWITHOUT_PARTITION_STORAGE_ENGINE=1\-DWITH_FAST_MUTEXES=1\-DWITH_ZLIB=bundled\-DENABLED_LOCAL_INFILE=1\-DWITH_READLINE=1\-DWITH_EMBEDDED_SERVER=1\-DWITH_DEBUG=0... Omit... Oaded-virtual-Wno-unused-parameter-- CMAKE_C_FLAGS_RELWITHDEBINFO:-O2-g-DNDEBUG-DDBUG_OFF-DMY_PTHREAD_FASTMUTEX=1-- CMAKE_CXX_FLAGS_RELWITHDEBINFO:-O2-g-DNDEBUG-DDBUG_OFF-DMY_PTHREAD_FASTMUTEX=1-- Configuring done-- Generating done-- Build files have been written to: / server/tools/mysql-5.5.52 [root@db01 mysql-5.5.52] # echo $? 0
-- basedir=/application/mysql-5.5.52\ >-- datadir=/application/mysql-5.5.52/data\ >-- user=mysqlInstalling MySQL system tables...161210 15:00:47 [Note] / application/mysql-5.5.52/bin/mysqld (mysqld 5.5.52) starting as process 21047... OKFilling help tables...161210 15:00:48 [Note] / application/mysql-5.5.52/bin/mysqld (mysqld 5.5.52) starting as Process 21054... OKTo start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your systemPLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER! To do so Start the server, then issue the following commands:/application/mysql-5.5.52/bin/mysqladmin-u root password' new-password'/application/mysql-5.5.52/bin/mysqladmin-u root-h db01 password' new-password'Alternatively you can run:/application/mysql-5.5.52/bin/mysql_secure_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly recommended for production servers.See the manual for more instructions.You can start the MySQL daemon with:cd / application/mysql-5.5.52; / application/mysql-5.5.52/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.plcd / application/mysql-5.5.52/mysql-test; perl mysql-test-run.plPlease report any problems at http://bugs.mysql.com/
If there are two OK above, the initialization of the database is complete.
9. Configure to launch MySQL
[root@db01 scripts] # cd [root@db01 ~] # cp / application/mysql/support-files/mysql.server / etc/init.d/mysqld [root@db01 ~] # chmod + x / etc/init.d/mysqld [root@db01 ~] # sed-I's applications SUCCESS!
Start the error report
# / etc/init.d/mysqld start
(1) start file saving
/ etc/init.d/mysqld: line 276: cd: / usr/local/mysql: there is no file or directory Starting MySQL ERROR! Couldn't find MySQL server (/ usr/local/mysql/bin/mysqld_safe)
Resolve:
Sed-I's accountUniverse usr _ application/mysql/bin/mysqld_safe _ etc/init.d/mysqld _ MySQL
(2) MySQL initiates error report
/ etc/init.d/mysqld start error: [root@mysql mysql] # / etc/init.d/mysqld startStarting MySQL.. ERROR! The server quit without updating PID file (/ var/lib/mysql/mysql.pid).
Problem: mysql initialization error
Resolve:
1. Clear the data data directory
Rm-f / application/mysql/data/*
two。 Reinitialize mysql
/ application/mysql/scripts/mysql_install_db-user=mysql-basedir=/application/mysql-datadir=/application/mysql/data/
3. Then re-operate from the step after the initialization step
Netstat-lntup | grep mysql
10. Join the boot self-startup
[root@db01 ~] # chkconfig mysqld on [root@db01 ~] # chkconfig-- list mysqldmysqld 0: off 1: off 2: enable 3: enable 4: enable 5: enable 6: close
11. Check the port
[root@db01 ~] # netstat-lntup | grep 3306tcp 0 0 0.0.0.0 lntup 3306 0.0.0.0 LISTEN 21333/mysqld
At this point, the MySQL database has been installed. O (∩ _ ∩) Odyssey databases has been installed!
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: 232
*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.