Install the mysql source code package (applicable to multiple mysql) and mysql source code

Source: Internet
Author: User

Install the mysql source code package (applicable to multiple mysql) and mysql source code
1. install the required package for compiling the code: yum list | grep ncurses-develyum-y install make gcc-c ++ cmake bison-devel ncurses-devel 2. download MySQL 5.6.35wget https://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.35.tar.gztar zxvf mysql-5.6.35.tar.gzcd mysql-5.6.35 3. directory Creation (-p parent directory does not exist, create this directory) mkdir-p/usr/local/mysql/data 4. compile cmake \-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \-DMYSQL_DATADIR =/usr/local/mysql/data \-DSYSCONFDIR =/etc \-runtime = 1 \-DWITH_INNOBASE_STORAGE_ENGINE = 1 \-DWITH_MEMORY_STORAGE_ENGINE = 1 \-DWITH_READLINE = 1 \-DMYSQL_UNIX_ADDR =/usr/local/mysql. sock \-DMYSQL_TCP_PORT = 3307 \-DENABLED_LOCAL_INFILE = 1 \-character = 1 \-DEXTRA_CHARSETS = all \-DDEFAULT_CHARSET = utf8 \-DDEFAULT_COLLATION = utf8_general_ci5. install make & make installmake clean 6. set permissions to check whether mysql users and user groups are available cat/etc/passwdcat/etc/group. If not, add mysql users and group groupadd mysqluseradd-g mysql Modify/usr/local/mysql permissions. chown-R mysql: mysql/usr/local/mysql 7. initialize the configuration cd/usr/local/mysql and execute the initialization configuration script, create the built-in database and table scripts/mysql_install_db -- basedir =/usr/local/mysql -- datadir =/usr/local/mysql/data -- user = mysqlcp/usr/local/mysql /support-files my. cnf 8. when starting the database, you must specify my. cnf (the system will first find/etc/my. cnf)/usr/local/mysql/bin/mysqld_safe -- defaults-file =/usr/local/mysql/my. cnf -- user = mysql & 9. modify the Database PASSWORD/usr/local/mysql3307/bin/mysql-urootSET PASSWORD = PASSWORD ('bbgolden '); grant all privileges on *. * TO 'root' @ '%' identified by 'bbgolden 'with grant option; flush privileges;

Related Article

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.