CentOS6.6 installing MySQL

Source: Internet
Author: User

two types of installation MYSQL the method

A. compile-free installation

1. First find a directory such as opt This catalog download MySQL installation package:

[Email protected] ~]# cd/opt

2. After entering, use wget or WinSCP , RZ various ways to Tar package into the directory.

[Email protected] opt]# wget http://syslab.comsenz.com/downloads/linux/mysql-5.1.40-linux-x86_64-icc-glibc23.tar.gz

When you're done downloading, you'll see Tar the package (Figure 1 )

650) this.width=650; "style=" Float:none; "title=" 1 "src=" http://s3.51cto.com/wyfs02/M01/6C/2B/ Wkiom1vbbnwgno0vaabyw49w8i8199.jpg "alt=" Wkiom1vbbnwgno0vaabyw49w8i8199.jpg "/>

3. Then unzip the Tar Package

[Email protected] opt]# TAR-ZXVF mysql-5.1.40-linux-x86_64-icc-glibc23.tar.gz

4. After the decompression is complete, you can do LN you can also directly MV renamed, we MV to the /usr/local/mysq down.

[Email protected] opt]# MV Mysql-5.1.40-linux-x86_64-icc-glibc23/usr/local/mysql

5. Create a MySQL User

[[email protected] mysql]# useradd-s/sbin/nologin MySQL

6. Then go to create a MySQL The data storage directory

[[email protected] mysql]# mkdir-p/data/mysql (the catalogue is not dead, as long as you remember)

7. Because later MySQL must be to the directory to operate, that must have permission, so the newly created directory to the user, by the way, just unzip the Tar transfer.

[Email protected]/]# chown-r mysql:mysql/data/mysql/[[email protected] local]# chown-r mysql:mysql/usr/local/mysql/

8. Next you need to initialize MySQL

[Email protected] scripts]#/mysql_install_db--user=mysql--datadir=/data/mysql

This implementation will inevitably error, look at the error message it! (Fig . 2)

650) this.width=650; "style=" Float:none; "title=" 2 "src=" http://s3.51cto.com/wyfs02/M02/6C/27/ Wkiol1vbbj3tkczvaagtmqpxs6m031.jpg "alt=" Wkiol1vbbj3tkczvaagtmqpxs6m031.jpg "/>

For the workaround, try the following command (which is why I am not clear, ask the big God pointing)

[Email protected] scripts]#/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/data/mysql

when the command is executed, the next error occurs: (Figure 3 )

650) this.width=650; "style=" Float:none; "title=" 3 "src=" http://s3.51cto.com/wyfs02/M02/6C/2B/ Wkiom1vbbnbwuscaaar2kkodmiu465.jpg "alt=" Wkiom1vbbnbwuscaaar2kkodmiu465.jpg "/>

do not panic chicken move, carefully read the wrong message, said that is not find anything, then I think it is less loaded things, then I TM How to know what was missing, and then God told me: (Figure 4 )

[email protected] scripts]# Yum install compat-libstdc++-33

650) this.width=650; "style=" Float:none; "title=" 4 "src=" http://s3.51cto.com/wyfs02/M00/6C/27/ Wkiol1vbbj6igbztaaq3tizfm4u637.jpg "alt=" Wkiol1vbbj6igbztaaq3tizfm4u637.jpg "/>

Thank God!

9. The Support-files under the my-large.cnf Replace etc/my.cnf under

[email protected] support-files]# CP my-large.cnf/etc/my.cnf CP: Do you want to overwrite "/etc/my.cnf"? Y

10. Also to Mysql.server cover to Etc/init.d/mysqld

[email protected] support-files]# CP mysql.server/etc/init.d/mysqld

11.Mysqld the file is important. We're going to modify his permissions, but it's like copying the past directly 755 up.

[Email protected] init.d]# chmod 755 mysqld

12. Next we will modify the parameters in the service startup file.

[Email protected] init.d]# Vim/etc/init.d/mysqld

Find Basedir and the DataDir , change them according to your situation, and don't forget to change them. Wq :

Basedir=/usr/local/mysqldatadir=/data/mysql

13. Add MySQL service, and open MySQL Service

[[email protected] init.d]# chkconfig--add mysqld[[email protected] init.d]# chkconfig mysqld on

It's time for the chicken to move, start MySQL Service

[[Email protected] init.d]# service mysqld startstarting MySQL. success!

Let's test whether we can go in, here to pay attention, some students see online tutorials directly mysql–u–p may be prompted " I thought of the dog, because I also met Ah, day his brother ~ calm down and think about it. The system defaults to find the Span style= "FONT-FAMILY:CALIBRI;" >/usr/bin/mysql Do you have it? , if we're not going to be honest. /usr/local/mysql/bin run under it. You know, if you're proud, you must mysql direct can run, then add path Yes, thank God! (Figure 5 )

650) this.width=650; "style=" Float:none; "title=" 5 "src=" http://s3.51cto.com/wyfs02/M00/6C/2B/ Wkiom1vbbnbsoxq0aaf6u04jyg8836.jpg "alt=" Wkiom1vbbnbsoxq0aaf6u04jyg8836.jpg "/>

you know that. ~ Thank God ~~ !

Not to be continued! ......

This article is from the "Hotel.gouwa" blog, make sure to keep this source http://nuoyiwang.blog.51cto.com/7316609/1640553

CentOS6.6 installing MySQL

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.