Install MySQL databases in CentOS

Source: Internet
Author: User
Install CentOS for MySQL databases in CentOS

The predecessors always said that they should learn and record while summing up. Therefore, we started to record the 1.1 points learned every day.

Complex theories are not understood. they will only be installed currently. after the installation, you will start playing!

1. download the corresponding rpm installation package from the official website.

: Http://dev.mysql.com/downloads/mysql/5.6.html#downloads

For example, I only downloaded these three files.

2. you will use the rpm command for installation (relatively familiar)

In fact, this should be step 1.

#rpm -ivh MySQL-client-5.6.19-1.el6.i686.rpm#rpm -ivh MySQL-devel-5.6.19-1.el6.i686.rpm#rpm -ivh MySQL-server-5.6.19-1.el6.i686.rpm

Enter (restart database) after installation: service mysql restart

Error: mysql unrecognized service

The reason is that mysql was not deleted before ~~ Delete it!

3. delete the original mysql

First, find the original rpm-qa | grep mysql

Delete the preceding three items one by one:

After deletion, go back to step 2 and reinstall.

4. modify the root password (this root account is the root account of mysql, not the root account of Linux ).

Change password input: # mysqladmin-u root password 'root'
Then an error occurs)
Error: 'Access denied for user' root' @ 'localhost''

And then Baidu. use the following method to solve the problem:

# Service mysql stop # mysqld_safe -- user = mysql -- skip-grant-tables -- skip-networking & # mysql-u root mysqlmysql> UPDATE user SET Password = PASSWORD ('newpassword (SET new password) ') where USER = 'root'; mysql> flush privileges; mysql> quit #/etc/init. d/mysql restart # mysql-uroot-pEnter password:
 <输入新设的密码>

5. test whether the installation is successful:

Input: mysql> show databases;

The semicolon must be added; otherwise, an error is displayed.

However, even if I add a semicolon, an error occurs (T ^ T)

ERROR 1820 (HY00): You must set password before executing this statement

I once again witnessed the strength of Baidu

Input: mysql> set password = PASSWORD ('2017 (your PASSWORD )');

Reset the password!

Then, it seems like you can ~~

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.