CentOS6.5 Source Installation MySQL5.6.35

Source: Internet
Author: User
Tags mysql code parent directory

It is very convenient to install MySQL with the RPM package on the next article. But after installing it, I don't know which folder the files are saved in! Try to use source installation ~
This article is for the main reference: CentOS 6.4 Compile and install MySQL 5.6.14

First, uninstall the old version1, use the following command to check if a mysql[[email protected] tools]# rpm is installed-qa|grep-i mysql2, some words will uninstall [[email protected] tools]#YumRemove mysql-server-5.6. *-1. El6.i686[[email protected] tools]#YumRemove mysql-devel-5.6. *-1. El6.i686[[email protected] tools]#YumRemove mysql-client-5.6. *-1. El6.i686[[email protected] tools]#YumRemove mysql-utilities-1.6.5-1. El6.noarch[[email protected] tools]#YumRemove mysql-connector-python-2.1.5-1. el6.i6863, delete the relevant directory [[email protected] tools]#WhereisMysql[r[email protected] tools]#RM-rf/usr/share/MySQL [[email protected] tools]#RM-rf/var/lib/Mysql[[email protected] mysql]#MV/usr/lib/mysql/usr/lib/Mysql.bak #这个当时不确定是rmp包所创建, temporarily renamed second, install MySQL4, install the package required for compiling the code [[email protected] tools]#YumList|grepncurses-Devel[[email protected] tools]#Yum-YInstall  Make GCC-c++ CMake Bison-devel ncurses-devel5, download MySQL5.6. *[email protected] tools]#wgetHttps//cdn.mysql.com//downloads/mysql-5.6/mysql-5.6.35.tar.gz[Email protected] tools]#TarZXVF mysql-5.6. *.Tar. Gz[[email protected] tools]# CD MySQL-5.6. *the first time the download was wrong (MySQL-5.6. *-LINUX-GLIBC2.5-i686.Tar. gz), always error at compile time cmake error:the source directory "*"does not appear to contain CMakeLists.txt. To select Source Community under MySQL code!!! Server 6, Directory Creation (-P Parent Directory does not exist then create this directory) [[email protected] MySQL-5.6. *]#mkdir-p/usr/local/mysql/Data7, compile and install [[email protected] MySQL-5.6. *]# CMake-dcmake_install_prefix=/usr/local/MySQL-dmysql_datadir=/usr/local/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=/usr/local/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_ci[[email protected] MySQL-5.6. *]# Make&& Make Install[[email protected] MySQL-5.6. *]# MakeClean Three, configure MySQL8, set permissions to see if there are MySQL users and user groups [[email protected] MySQL-5.6. *]#Cat/etc/passwd[[email protected] MySQL-5.6. *]#Cat/etc/group Add MySQL user and group if not [[email protected] MySQL-5.6. *]# groupadd Mysql[[email protected] mysql-5.6. *]# Useradd-g MySQL MySQL modify/usr/local/mysql permissions [[email protected] MySQL-5.6. *]#Chown-R mysql:mysql/usr/local/MySQL9, initialize the configuration into the installation path [[email protected] MySQL-5.6. *]# cd/usr/local/MySQL Executes the initialization configuration script to create the system's own database and table [[email protected] mysql]# scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=MySQLTen, start the MySQL add service, copy the service script to the INIT.D directory ifThe/etc directory has a previously existing my.cnf file and renames it. When you start the MySQL service, it takes precedence over/etc directory lookup [[email protected] mysql]#MV/etc/my.cnf/etc/my.cnf.bak #[[email protected] mysql]#CPsupport-files/mysql.server/etc/init.d/Mysql[[email protected] mysql]# chkconfig mysql on[[email protected] mysql]# service MySQL start--start MySQL One, configure user settings Path[[email protected] mysql]# PATH=/usr/local/mysql/bin: $PATH [[email protected] mysql]# export Path[[email protected] mysql]# source/etc/Profile change root password [[email protected] mysql]# MySQL-Urootmysql> SET PASSWORD = PASSWORD ('mysql5635'); Set MYDBA users can access MySQL remotely> GRANT All privileges on * * to'MYDBA'@'%'Identified by'mysql5635'With GRANT OPTION, firewall settings can refer to http://www.cnblogs.com/ShanFish/p/6519950.html Aand re-login to the terminal after exiting [email protected]~]# Mysql-uroot-Pbash:mysql:command not found use the full path to log in [[email protected]~]#/usr/local/mysql/bin/mysql-uroot-penter Password:'/usr/local/mysql/bin:'this is added to the path, do not know why you can not directly use MySQL to build a soft link, other commonly used commands mysqladmin, mysqldump and so on can be used to solve the problem [[email protected]~]#LN-s/usr/local/mysql/bin/mysql/usr/bin

Then you can play MySQL with peace of mind ~, we can import sample data, install MySQL utilities and so on ~ ~ ~

CentOS6.5 Source Installation MySQL5.6.35

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.