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 MySQL 5.6 through source code compilation under CentOS 6.7

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly shows you "CentOS 6.7 how to install MySQL 5.6 through source code compilation", the content is easy to understand, well-organized, hope to help you solve your doubts, the following let the editor lead you to study and learn "CentOS 6.7 how to install MySQL 5.6 through source code compilation" this article.

1. Install the underlying support package

Shell > yum-y install gcc gcc-c++ wget make cmake ncurses-devel bison

2. Create users and groups

Shell > useradd-r mysql

3. Download and install Mysql

Ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.6/

# # download address

Ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.6/mysql-5.6.25.tar.gz

Shell > cd / usr/local/src

Shell > tar zxf mysql-5.6.25.tar.gz

Shell > cd mysql-5.6.25

Shell > cmake.

Shell > make & & make install

# # reference address for Cmake parameters: http://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html

-DCMAKE_INSTALL_PREFIX=dir_name # # Mysql installation location (default location)

-DMYSQL_DATADIR=dir_name # # Mysql database location

-DMYSQL_TCP_PORT=port # # Mysql listening port

-DDEFAULT_CHARSET=utf8 # # default character set of Mysql database

-DSYSCONFDIR=dir_name # # Mysql configuration file location

-DMYSQL_UNIX_ADDR=/tmp/mysql_v5.sock # # SOCK file location

# # wait. There are many more, not to be listed one by one. Cmake. Indicates that the default setting is used. You can see the default option in the reference address.

Shell > cd / usr/local/

Shell > chown-R root:mysql mysql/

Shell > chown-R mysql mysql/data/

Shell > cp mysql/support-files/mysql.server / etc/init.d/mysqld

Shell > cp mysql/support-files/my-default.cnf / etc/my.cnf

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

Shell > cd

Shell > echo "PATH=$PATH:/usr/local/mysql/bin/" > > / etc/profile

Shell > source / etc/profile

4. Start Mysql

Shell > service mysqld start

Shell > netstat-lnpt | grep 3306

Tcp 0 0: 3306: * LISTEN 16206/mysqld

# # you can see that it has been launched successfully

# # this is the last time I deployed Mysql on Ali CVM and started the Times:

Starting MySQL...The server quit without updating PID file [FAILED] cal/mysql/data/Mysql.com.pid.

# # unable to start. An error in the log roughly means that there is not enough memory (need to be greater than / equal to 1G) ~ ~ there is no problem this time.

# # later, I found a configuration file with small memory provided in Mysql version 5.5, and I can start it!

5. Installation is complete and testing

Shell > mysql # # the first time you log in, you can log in directly by entering the mysql command (I remember that there is a root password by default, which is stored in the next hidden file for root users, but not this time)

Shell > mysqladmin-uroot-p password 888888 # # 888888 is the new password set. Enter directly below.

Enter password:

Warning: Using a password on the command line interface can be insecure. # # modify the password and output a warning message that it is not safe to put the password on the command line ~ ~

Shell > mysql-uroot-p888888 # # Log in to Mysql again

Mysql > update mysql.user set password=password ('123456') where user='root'

Query OK, 4 rows affected (0.05sec)

Rows matched: 4 Changed: 4 Warnings: 0

Mysql > flush privileges

Query OK, 0 rows affected (0.02 sec)

# # the second way to change password

Mysql > grant all on *. * to root@'%' identified by '666users; # # authorized root users can log in from any address with a password of 666

Query OK, 0 rows affected (0.04 sec)

Shell > mysql-uroot-h 192.168.214.20-p666

# # grant does not need to perform flush operation, but it is recommended to flush ~ ~

# # steps to solve if you forget your root password

Shell > / etc/init.d/mysqld stop

Shell > / usr/local/mysql/bin/mysqld_safe-- skip-grant-table & # # Skip the authorization table to start Mysql

Shell > mysql # # can happily log in to the database without a password ~ ~

Mysql > update mysql.user set password=password ('123456') where user='root'

Mysql > flush privileges

Query OK, 0 rows affected (0.04 sec)

The above is all the contents of the article "how to install MySQL 5.6 through source code compilation under CentOS 6.7.Thank you for reading!" I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow 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