MySQL installation on Linux operating system

Source: Internet
Author: User

In other words, this installation of MySQL is really twists, did not expect such trouble. I installed it with Yum Source and first provided some things to install MySQL with yum.

Must be well equipped with Yum source, yum source problems can be referred to my previous blog content

1. Install MySQL

Yum Install Mysql-server--This must be mysql-server, not yum install Mysql,mysql-server is the service End, you can use Yum search MySQL to view some of the contents of the Yum source about MySQL.

2. Start MySQL

/etc/init.d/mysqld start

3. Set the password for the root user

Mysql-uroot-p--An error.

Linux MySQL 5.6:error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)

Workaround:

A, first stop MySQL

/etc/init.d/mysqld stop

B

[[email protected] init.d]# mysqld_safe--user=mysql--skip-grant-tables--skip-networking &--skip Permission table and network protocol

[Email protected] init.d]# 1 mysqld_safe Logging to '/var/lib/mysql/db-server.err '.

140722 Mysqld_safe starting mysqld daemon with databases From/var/lib/mysql

Here you can just ctrl +c, then proceed to the next step.

C, mysql-u root mysql--enter MySQL

Mysql>update user Set Password=password (' 123456 ') where user= ' root ' and host= ' root ' or host= ' localhost ';
mysql> flush Privileges;

Mysql> quit
/etc/init.d/mysqld Restart--restart MySQL
Mysql-u Root-p will be able to set a new password.




MySQL installation on Linux operating system

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.