MySQL Database < two >

Source: Internet
Author: User
Tags mysql version

Yum install MySQL


There are many ways to install MySQL, and now we are mainly talking about yum installing MySQL.


1. MySQL website

www.mysql.com to download the latest version

2.MySQL packages that need to be installed

MySQL-server Server

MySQL client

Mysql-devel Library file

3. Installing the MySQL database:

yum list|grep mysql      # See if a MySQL package is installed rpm -qa |grep mysql-server       #查看是否已安装mysql包    yum -y install mysql-server mysql mysql-devel    # Yum install MySQL required package rpm -qa |grep mysql      service mysqld  start       #启动服务, automatic initialization of service mysqld restart    # Start again, initialization is complete 

at this point, the default only Root user, and no password is required to initialize the password:

Mysqladmin-uroot password ' 123 ' #初始化密码

Log in to the MySQL database:

Mysql-uroot-p ' 123 '

To exit the database:

Mysql> exit or Mysql> quit

To add the MYSQLD service to boot:

Chkconfig mysqld on

To view the port status of MySQL:

[[email protected] ~]# netstat-lntup|grep mysqltcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2071/mysqld

Note: The default port for MySQL is 3306, and the default protocol is TCP

To view MySQL version information:

Rpm-qi Mysql-server

4. mysql Important configuration file

/ETC/MY.CNF #mysql配置文件保存位置

/var/lib/mysql/#mysql Database save data File location

Datadir=/var/lib/mysql The configuration file for the MySQL database default save location, which can be modified in the Vim Editor

/var/log/# default log save location

Mysqld.log # log File



This article is from the "Lanzhi" blog, make sure to keep this source http://7826443.blog.51cto.com/7816443/1706107

MySQL Database < two >

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.