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 > Servers >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the Mysql compilation and installation handouts of LAMP architecture, hoping to add and update some knowledge, if you have other questions to understand, you can continue to follow my updated article in the industry information.
First, the MysqlLAMP architecture of LAMP architecture is divided into three blogs, this one is about the compilation and installation of database Mysql. First of all, these software packages are downloaded to the windows system by smb sharing and remotely mounted to the Linux system. Command: the installation package needed by smbclient-L Baidu Cloud link has been shared in the previous blog, blog link: build LMAP architecture Apache configuration (part 1) 2, install MYSQL process 2.1, first install the environment package yum install ncurses-devel autoconf cmake-y2.2, extract the package [root@localhost init.d] # cd / abc/LAMP-C7/ [root@localhost LAMP-C7] # tar zxvf mysql-5.6.26.tar.gz-C / opt/
Switch to the path of the mysql-5.6.26 file and see cmake
2.4. The save path remains unchanged Perform cmake configuration cmake\-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general_ci\-DEXTRA_CHARSETS=all\-DSYSCONFIDIR=/etc\-DMYSQL_DATADIR=/home/mysql/\-DMYSQL_UNIX_ADDR=/home/mysql/mysql.sock-- for detailed explanation of the above commands- -DCMAKE_INSTALL_PREFIX=/usr/local/mysql\ # points to the installation directory of mysql-DDEFAULT_CHARSET=utf8\ # character set Encoding-DDEFAULT_COLLATION=utf8_general_ci\ # character set alignment rules-DEXTRA_CHARSETS=all\-DSYSCONFIDIR=/etc\ # mysql configuration file directory (/ etc)-DMYSQL_DATADIR=/home/mysql/\ # mysql data file directory (/ home/mysql)-DMYSQL_UNIX_ADDR=/home/mysql/mysql.sock # communication file for the connection database 5. Under the same path For make compilation, it will take a long time to wait for make6, keep the path unchanged, install make install7 for make install, modify the configuration file, and grant permission [root@localhost mysql-5.6.26] # cp support-files/my-default.cnf / etc/my.cnfcp: whether to overwrite "/ etc/my.cnf"? Y [root@localhost mysql-5.6.26] # cp support-files//mysql.server / etc/init.d/mysqld [root@localhost mysql-5.6.26] # chmod 755 / etc/init.d/mysqld / / add mysql to SERVICE Manager [root@localhost mysql-5.6.26] # chkconfig-- add / etc/init.d/mysqld [root@localhost mysql-5.6.26] # chkconfig mysql--level 235 on8, Environment variable change [root@localhost mysql-5.6.26] # echo "PATH=$PATH:/usr/local/mysql/bin" > > / etc/profile [root@localhost mysql-5.6.26] # source / etc/profile [root@localhost mysql-5.6.26] # echo $PATH
9. Add MySQL users, specify the group [root@localhost mysql-5.6.26] # useradd-s / sbin/nologin mysql [root@localhost mysql-5.6.26] # chown-R mysql.mysql / usr/local/mysql/10, and switch to the / usr/local/mysql/scripts/mysql_install_db directory for database configuration.
/ usr/local/mysql/scripts/mysql_install_db\-- user=mysql\-- ldata=/var/lib/mysql\-- basedir=/usr/local/mysql\-- datadir=/home/mysql11, in the / etc/init.d/mysqld file, add the following two lines: vim/etc/init.d/mysqldbasedir=/usr/local/mysqldatadir=/home/mysql
12. Optimize the path and enable the database service ln-s / var/lib/mysql/mysql.sock / home/mysql/mysql.sockservice mysql startnetstat-anpt | grep 3306
13. Set the password mysqladmin-u root-p password "abc123" to the root account
3. The operation command of the database can be entered directly without a password: mysql-u root enter if you have a password, enter: mysql-u root-p enter, enter the database after entering the password
Show databases; / / View all databases in the current CVM use bbs; / / use switch library, switch to bbs library show tables; / / view all tables in the library create database bbs; / / create a new library bbs# must end with';', otherwise it will not take effect. Exit / / exit database 4. The role of Mysql MySQL database server: is the back end of LAMP architecture, open source relational database system, data is stored in MySQL database, can be queried by SQL statement
Read the above Mysql compilation and installation handouts on LAMP architecture, hoping to bring some help to you in practical application. Due to the limited space in this article, it is inevitable that there will be deficiencies and need to be supplemented. If you need more professional answers, you can contact us on the official website for 24-hour pre-sales and after-sales to help you answer questions at any time.
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.