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

Mysql5.6.35 compilation and installation

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

Share

Shulou(Shulou.com)06/01 Report--

Before installing, make sure that the local mysql has been uninstalled:

Rpm-e mysql / / normal delete mode rpm-e-- nodeps mysql / / does not resolve dependencies

Install mysql:

Install the packages required to compile the code:

Yum-y install make gcc-c++ cmake bison-devel ncurses-devel

Download and extract mysql:

Tar xvf mysql-5.6.35.tar.gz

Cd mysql-5.6.35

Compile and install:

Cmake\-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\ / installed directory-DMYSQL_DATADIR=/usr/local/mysql/data\ / / data storage directory-DSYSCONFDIR=/etc\ / / configuration file directory-DWITH_MYISAM_STORAGE_ENGINE=1\ / / support myisam storage engine-DWITH_INNOBASE_STORAGE_ENGINE=1\ / / support innodb storage engine-DWITH_MEMORY_STORAGE_ENGINE=1 \-DWITH_READLINE=1\-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock\-DMYSQL_TCP_PORT=3306\-DENABLED_LOCAL_INFILE=1\-DWITH_PARTITION_STORAGE_ENGINE=1\-DEXTRA_CHARSETS=all\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general_cimake & & make install

Configure mysql:

Groupadd mysqluseradd-g mysql mysql

Modify / usr/local/mysql permissions

Chown-R mysql:mysql / usr/local/mysql

Initialize mysql configuration

Cd / usr/local/mysqlscripts/mysql_install_db-basedir=/usr/local/mysql-datadir=/usr/local/mysql/data-user=mysqlmv / etc/my.cnf {, .bak}

Note: when starting the MySQL service, the my.cnf will be searched in a certain order, first in the / etc directory, and if it cannot be found, it will search for "$basedir/my.cnf", in this case / usr/local/mysql/my.cnf, which is the default location of the configuration file for the new version of MySQL!

Note: after the minimum installation of the CentOS version 6.8 operating system is completed, there will be a my.cnf in the / etc directory. You need to rename this file to another name, such as / etc/my.cnf.bak, otherwise, the file will interfere with the correct configuration of the MySQL installed by the source code, resulting in failure to boot.

After updating the system with "yum update", you need to check to see if there is an extra my.cnf in the / etc directory, and if so, rename it to something else. Otherwise, MySQL will start with this configuration file, which may cause problems such as not starting properly.

Start mysql:

Add the service script to the init.d directory and set boot up

Cp support-files/mysql.server / etc/init.d/mysqlchkconfig mysql on

Create a new sock directory for mysql and start

Mkdir / var/lib/mysqlchown-R mysql.mysql / var/lib/mysqlservice mysql start-start MySQL

Set PATH, or you can't call mysql directly, modify the / etc/profile.d/mysql.sh file, and add at the end of the file

Export PATH=/usr/local/mysql/bin:$PATH. / etc/profile.d/mysql.sh

Change the root password:

Mysql-uroot mysql > SET PASSWORD = PASSWORD ('123456')

Set root users to remotely access:

Mysql > GRANT ALL PRIVILEGES ON *. * TO 'root'@'192.168.%' IDENTIFIED BY' password' WITH GRANT OPTION

When the red password is remote access, the password of the root user can be different from that of the local user.

At this point, mysql compilation and installation is complete.

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