MySQL----installed under Linux

Source: Internet
Author: User

First, installation environment

operating system:Linux

Mysql version:mysql-5.6.24

Second, the required software

Mysql-5.6.24.tar.gz

third, installation steps(1) Upload the installation package

Mkdir/usr/setup

upload mysql-5.6.24.tar.gz to /usr/setup

(2) Installation dependency
Yum-y install make gcc-c++ cmakebison-devel ncurses-devel
(3)Verify that you have installedMysql

To find out if the relevant components of the MySQL database are already installed in the system , use the command:

Rpm-qa | grep MySQL

To find, if found, you can use the following command to force uninstall:

RPM-E--nodeps package name.


(4)Compiling the installation
cd /usr/setup/tar -zxvf mysql-5.6.24.tar.gzcd mysql-5.6.24 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=/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_ci                      &nbSp;        -dwith_ssl=yes 
Makemake Install

(5) Create a user
Groupadd mysqluseradd-g MySQL Mysqlchown mysql.mysql/usr/local/mysql–r
(6) Initializing database files
/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql/--datadir=/usr/local/mysql/ Data
(7)CopyMysqlconfiguration files and startup files
cp/usr/setup/mysql-5.6.24/support-files/my-default.cnf/etc/my.cnfcp/usr/setup/mysql-5.6.24/support-files/ Mysql.server/etc/init.d/mysqldchmod +x/etc/init.d/mysqld vi/etc/my.cnf[mysqld]# #添加下面的内容datadir =/usr/local/mysql/ Datasocket =/var/lib/mysql/mysql.sockbasedir =/usr/local/mysql/port = 3306server_id = 1report-port =3306
(8) StartMysql
/etc/init.d/mysqld start
(9)Login
/usr/local/mysql/bin/mysql-uroot-p does not have a password by default.
(10) Change Password
/usr/local/mysql/bin/mysqladmin-uroot password ' mysql ' Login test/usr/local/mysql/bin/mysql–uroot-p


(11)Other Configurations
Set boot self-boot chkconfig mysqld onchkconfig--list|grep mysql add mysql environment variable vi/etc/profilepath=/usr/local/mysql/bin:$ Pathexport PATH source/etc/profile Delete empty user mysql-uroot-puse mysql;selectdistinct (user) from User;delete to userwhere use R= '; flushprivileges;selectdistinct (user) from user;

References:

http://jingyan.baidu.com/article/67508eb43f68869cca1ce4e5.html?qq-pf-to=pcqq.c2c


This article is from the "Notes" blog, so be sure to keep this source http://sunflower2.blog.51cto.com/8837503/1651710

MySQL----installed under Linux

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.