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

How to install MySQL5.6 in Redhat6.5

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

Share

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

This article mainly introduces "Redhat 6.5 how to install MySQL 5.6", in daily operation, I believe many people in Redhat 6.5 how to install MySQL 5.6 problems have doubts, Xiaobian consulted all kinds of information, sorted out simple and easy to use operation methods, hope to answer "Redhat 6.5 how to install MySQL 5.6" doubts helpful! Next, please follow the small series to learn together!

1. Install make compiler, the system has been installed

2. Install bison, the system has been installed

3. Install gcc-c++, the system has been installed

4. Install ncurses, the system has been installed

5, Install cmake, Download cmake-3.4.3 source package, Install

Create MySQL user groups and users

groupadd -g 300 mysql

useradd -u 300 -g mysql mysql

Unzip and install mysql

tar -zxvf mysql-5.6.35.tar.gz

cd mysql-5.6.35

cmake to compile

cmake . \

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \

-DMYSQL_DATADIR=/mysql/data \

-DSYSCONFDIR=/etc \

-DWITH_MYISAM_STORAGE_ENGINE=1 \

-DWITH_INNOBASE_STORAGE_ENGINE=1 \

-DWITH_MEMORY_STORAGE_ENGINE=1 \

-DWITH_READLINE=1 \

-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock \

-DMYSQL_TCP_PORT=3306 \

-DENABLED_LOCAL_INFILE=1 \

-DWITH_BOOST=/usr/local/boost/ \

-DWITH_PARTITION_STORAGE_ENGINE=1 \

-DEXTRA_CHARSETS=all \

-DDEFAULT_CHARSET=utf8 \

-DDOWNLOAD_BOOST=1 \

-DDEFAULT_COLLATION=utf8_general_ci

# make

# make install

8. Initialize the database

cd /usr/local/

chown -R mysql:mysql mysql

cd /usr/local/mysql/scripts

./ mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/mysql/data

cd /usr/local/mysql/support-files

cp my-default.cnf /etc/my.cnf

vi /etc/my.cnf

Add the following:

[mysqld]

user=mysql

datadir=/mysql/data

default-storage-engine=MyISAM

skip-grant-tables

socket=/tmp/mysqld.sock

[client]

default-character-set=utf8

socket=/tmp/mysqld.sock

[mysql]

socket=/tmp/mysqld.sock

default-character-set=utf8

9. Add mysql startup service to system service

# cp support-files/mysql.server /etc/init.d/mysql

mysql can now be started using the following command

# service mysql start

Stop mysql service

# service mysql stop

Restart mysql service

# service mysql restart

10. Modify the root password

If you don't know the root password of the MySQL database that has just been installed, you can use the following methods to set it up

Add "skip-grant-tables" to/etc/my.cnf [mysqld] configuration section

Restart MySQL service

mysql -uroot -p login database (no password)

show databases;

use mysql;

update user set password=password("mysql") where user='root';

flush privileges;

Remove "skip-grant-tables" from/etc/my.cnf [mysqld] configuration section

Restart mysql service

service mysqld restart

Login with new password

mysql -uroot -p

At this point, the study of "Redhat 6.5 how to install MySQL 5.6" is over, and I hope to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

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