In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
First of all, MySQL is a relational database, what is a relational relational database, we also talked about the advantages and disadvantages, in the previous blog: https://blog.51cto.com/14573101/2447264
Now let's talk about how MySQL can be installed:
1.RPM | yum is fast and easy to install, and cannot be customized.
two。 Binary: no need to install, decompress and use it. It cannot be customized.
3. Compilation and installation: slow installation and customizable
Before 5.5:. / configure make make install
After 5. 5: cmake gmake
4. Compile first, then make rpm, make yum library, and then install yum
Simple, fast, customizable, slightly complex, long production time
Here we choose 3. Compile and install, first prepare the installation package, here we use MySQL5.6.36
Click the official download mysql-5.6.36.tar.gz
Baidu cloud disk download official website MySQL-5.6.36: extraction code: R46x
1. Install the dependency package and cmake:
Yum install-y ncurses-devel libaio-devel cmake
two。 Create a mysql user
Useradd-s / sbin/nologin-M mysql
Check user: id mysql
3. Upload the downloaded installation package to the software storage directory in the system
4. Decompression
Tar xf mysql-5.6.36
5. Enter the decompressed directory
Cd mysql-5.6.36
6. Start installation
Cmake. -DCMAKE_INSTALL_PREFIX=/application/mysql-5.6.36\-DMYSQL_DATADIR=/application/mysql-5.6.36/data\-DMYSQL_UNIX_ADDR=/application/mysql-5.6.36/tmp/mysql.sock\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general_ci\-DWITH_INNOBASE_STORAGE_ENGINE=1\-DWITH_FEDERATED_STORAGE_ENGINE=1\-DWITH_BLACKHOLE_STORAGE_ENGINE=1\-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1\-DWITH_ZLIB=bundled\- DWITH_SSL=bundled\-DENABLED_LOCAL_INFILE=1\-DWITH_EMBEDDED_SERVER=1\-DENABLE_DOWNLOADS=1\-DWITH_DEBUG=0make & & make install
The above is our own definition of metadata, but universal
At this point, the compilation is complete and the configuration optimization begins.
7. Make the soft connection of mysql directory (the function of making soft connection: easy to upgrade, optimize commands, etc.)
Ln-s / application/mysql-5.6.36/ / application/mysql
8. Copy configuration fil
\ cp support-files/my*.cnf / etc/my.cnf
9. Initialize the database
/ application/mysql/scripts/mysql_install_db-basedir=/application/mysql/-datadir=/application/mysql/data-user=mysql
10. Create the tmp directory (because we defined the sock file here)
Mkdir-p / application/mysql/tmp
11. Set permissions for the mysql folder to avoid insufficient permissions and other problems
Chown-R mysql.mysql / application/mysql/
twelve。 Set up the startup script
\ cp-a support-files/mysql.server / etc/init.d/mysqld
13. You can start mysql!
/ etc/init.d/mysqld start
Check to see if it starts
Netstat-lntup | grep 3306ps-ef | grep mysqllsof-iVision 3306
14. Configure environment variables
Echo 'PATH=/application/mysql/bin/:$PATH' > > / etc/profiletail-1 / etc/profilesource / etc/profile type mysql on the command line to enter. The default empty password is Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 4Server version: 5.6.36 Source distributionCopyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.mysql >
Be careful! Every step can not be missing, especially download dependency and initialize the database, if there is an error, you can check the log or re-perform the steps to arrange errors!
If you have any questions, please leave a message and contact the blogger. I hope this article can help you get to the top of your life and marry Bai Fumei!
Congratulations, configure MySQL!
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.