Installation tutorial for mysql in linux, linuxmysql

Source: Internet
Author: User

Installation tutorial for mysql in linux, linuxmysql

Today, we need to use yum to install mysql. In fact, we can also download the mysql installation package on the official website to install it. However, I think it is appropriate to use yum to install it. I just reviewed it again.

The most important thing I learned earlier is that we can install some dependencies through yum, saving a lot of trouble!

1: switch to the root user

[Wls81 @ kafka001 wls81] # sudo su

2: Check whether mysql has been installed before.

Method 1:

[Root @ kafka001 wls81] # service mysqld status

Mysqld: unrecognized service

Method 2: [root @ kafka001 wls81] # rpm-qa | grep mysql

3: If you have installed mysql, you do not have to install it again. Check the available mysql database versions on yum.

[Root @ kafka001 wls81] # yum list | grep mysql

4: If the mysql version information is listed in step 3, you can install mysql.

[Root @ kafka001 wls81] # yum install-y mysql-server mysql-devel

5. view the basic information after installation.

[Root @ kafka001 wls81] $ rpm-qi mysql-server

So far, mysql installation is complete. Next we start mysql. Some Initialization Configuration Information will appear during the first startup, and it will not exist after it is started.

6. Start the mysql service.

[Root @ kafka001 wls81] $ service mysqld start

Every time we use mysql, we need to start mysql, which is very troublesome. Therefore, we need to set the following mysql auto-start

7. Set mysql to start automatically

[Root @ kafka001 wls81] # chkconfig mysqld on

8: Check whether there is a problem with mysql auto-start.

[Root @ kafka001 wls81] # chkconfig -- list | grep mysql

At this time, the installed mysql currently only has a root account, and no password is set, so you need to set the following password for the root user

[Root @ kafka001 wls81] # mysqladmin-u root password 'root'

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.