Install MySQL on CentOS

Source: Internet
Author: User
For cainiao, I would like to explain [install mysql]. It is a general term to use the mysql database on linux, but it is unclear how mysql runs. In fact, mysql scores

For cainiao, I would like to explain [install mysql]. It is a general term to use the mysql database on linux, but it is unclear how mysql runs. In fact, mysql scores

For cainiao, I would like to explain [install mysql]. It is a general term to use the mysql database on linux, but it is unclear how mysql runs.

In fact, mysql is divided into mysql server and mysql client. Therefore, these two [software packages] must be installed.

Previous mistakes:

In particular, the mysql server and mysql client are not clear before. After the terminal is opened, enter: mysql and the command is not returned.

Then take it for granted:

Yum install mysql

Finally, you can run this command and install it (you do not know what to install). After the installation is complete, run the following command:

Whereis mysql

You can also find the corresponding files and binary files. But execute:

Mysql

The *** sokcet cannot be opened. (Guess, the server does not start ).

Server mysql status

Chkconfig -- list mysql

No corresponding mysql appears, and of course no port 3306 is used (the default port of mysqld ).

After a long time, some of them are sure that mysql server is not installed.

Summary:

The main reason for this error is that I have not figured out what software I need to install to work on mysql, and I have not figured out the real functions of some commands (for example, yum install msyql ). Of course, there are also a lot of details. If you have any mistakes, you are welcome to make a picture.

Correct practice:

1. Download mysql server and mysql client from the official website.

Note the following:

[1] select the type of your computer when downloading. I chose Linux Generic (because this is the default option when I install it on the GUI ).

[2] Check the downloaded software package. The package contains component, lib, and so on. (I made a component at the time) and the score was 32 bits, or 64-bit.

I downloaded:

MySQL-server-5.5.27-1.linux2.6.i386.rpm

MySQL-client-5.5.27-1.linux2.6.i386.rpm

(Use wget directly on the terminal ).

2. Install mysql server.

In the downloaded directory:

Rpm-ivh MySQL-server-5.5.27-1.linux2.6.i386.rpm

Normally, it is installed by default (faster ).

After the installation is complete, you need to change the login password (I have not set it ):

/Usr/bin/mysqladmin-u root password 'new-password'

/Usr/bin/mysqladmin-u root-h localhost. localdomain password 'new-password'

Alternatively you can run:

/Usr/bin/mysql_secure_installation

Which will also give you the option of removing the test

Databases and anonymous user created by default. This is

Stronugly recommended for production servers.

See the manual for more instructions.

Please report any problems with the/usr/bin/mysqlbug script!

3. Install mysql client

Rpm-ivh MySQL-client-5.5.27-1.linux2.6.i386.rpm

4. Start mysql server

Service mysql start

When you view the port, you will find that port 3306 is occupied by mysqld.

[Xxh @ pc-20101003hbjg ~] $ Mysql
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 1
Server version: 5.5.27 MySQL Community Server (GPL)

Copyright (c) 2000,201 1, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.

Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.

Mysql>

Mysql is successfully installed.

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.