Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of mysql5.6.8 Source Code installation

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Xiaobian to share with you mysql5.6.8 source code installation example analysis, I believe most people still do not know how to share this article for your reference, I hope you read this article after a great harvest, let us go to understand it!

Core:

[root@opop ~]# cat /etc/centos-release CentOS release 6.8 (Final)[root@opop ~]# uname -aLinux opop 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Start installation:

[root@opop ~]# for i in `rpm -qa | grep mysql`;do yum remove $i;done //delete mysql[root@opop ~]# yum -y install wget gcc gcc-c++ ncurses-develop cmake make perl bison git

Create mysql user groups:

[root@opop ~]# groupadd mysql [root@opop ~]# useradd -r -g mysql mysql

Create mysql installation directory and database file storage directory:

[root@opop ~]# mkdir -p /usr/local/mysql[root@opop ~]# mkdir -p /usr/local/mysql/data

Modify directory owners and groups:

[root@opop ~]# chown -R mysql:mysql /usr/local/mysql/data [root@opop ~]# chown -R mysql:mysql /usr/local/mysql

Unpacking:

[root@opop ~]# tar -zxvf mysql-5.6.38.tar.gz[root@opop ~]# cd mysql-5.6.38

Compile:

[root@opop mysql-5.6.38 ]# cmake \-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \-DDEFAULT_CHARSET=utf8 \-DDEFAULT_COLLATION=utf8_general_ci \-DWITH_INNOBASE_STORAGE_ENGINE=1 \-DWITH_ARCHIVE_STORAGE_ENGINE=1 \-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \-DMYSQL_DATADIR=/usr/local/mysql/data \-DMYSQL_TCP_PORT=3306 \-DMYSQL_USER=mysql \-DENABLE_DOWNLOADS=1[root@opop mysql-5.6.38 ]# make && make install//Note: Compilation time is long, need to wait patiently//Check the results://[root@opop mysql-5.6.38 ]# ll /usr/local/mysql/

Clear temporary files:

[root@opop mysql-5.6.38 ]# make clean

Initialize mysql:

[root@opop ~]# cd /usr/local/mysql/[root@opop mysql]# scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data [root@opop mysql ]# chown -R mysql:mysql /usr/local/mysql [root@opop mysql ]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql[root@opop mysql ]# /etc/init.d/mysql start[root@opop mysql ]# ps -aux |grep mysql

Configure environment variables:

[root@opop mysql]# vim /etc/profile

coupled with

PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib export PATH

Reload profile (yes takes effect immediately)

[root@opop mysql]# source /etc/profile

Restart mysql service:

[root@opop mysql]# service mysql restart

First landing:

[root@opop mysql]# mysql -u root mysql

Authorized:

mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root";//Add the ability to connect remotely to root with caution.

Set database password:

mysql> update user set password = password('111111') where User='root'; //update root password to 6 1

Refresh:

mysql> flush privileges;

Withdrawal:

mysql> exit

Log in again after changing your password:

[root@opop mysql]# mysql -u root -p Enter password: //Enter 6 1's here to enter

Set up automatic startup service:

[root@opop mysql]# chkconfig mysql on The above is "mysql 5.6.8 source code installation example analysis" All the contents of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report