MySQL Database < four >

Source: Internet
Author: User

rpm Package Install MySQL


There are many ways to install MySQL, and now we are mainly talking about binary installation MySQL database.


Useradd mysql-s/sbin/nologin–m #创建用户tar XF mysql-5.5.32-linux2.6-x86_64.tar.gzmv mysql-5.5.32-linux2.6-x86_64/ Application/mysql-5.5.32ln-s/application/mysql-5.5.32//application/mysql/application/mysql/scripts/mysql_ install_db--basedir=/application/mysql/--datadir=/application/mysql/data/--user=mysql

See the following message stating the success of MySQL initialization:

Installingmysql system tables ... Okfillinghelp tables ... Ok
Chown-r Mysql.mysql/application/mysql #授权

Generate MySQL configuration file

Cp/application/mysql/support-files/my-small.cnf/etc/my.cnfcp:overwrite '/etc/my.cnf '? Y

Configure start MySQL, modify MySQL path, and start MySQL

Sed-i ' S#/usr/local/mysql#/application/mysql#g '/application/mysql/bin/mysqld_safe

Running in the background

/application/mysql/bin/mysqld_safe &

Configuring Environment variables

Vim/etc/profile path= "/application/mysql/bin: $PATH" Source/etc/profile #使变量生效

Configured as a traditional service startup mode

Cp/application/mysql/support-files/mysql.server/etc/init.d/mysqld

Replace path

Sed-i ' S#/usr/local/mysql#/application/mysql#g '/etc/init.d/mysqld

Start the service

/etc/init.d/mysqld Startshuttingdown mysql.broadcastmessage from [e-mail protected] (/dev/pts/0) at 21:53 ... Thesystem is going down for reboot now! success! Startingmysql.

To view ports:

Netstat-lntup |grep 3306

Change Password

Mysqladmin-uroot password ' 123 '

Log in to Database

Mysql-uroot-p ' 123 '


The database installation is complete.

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

MySQL Database < four >

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.