Linux installation MySQL database--yum installation method

Source: Internet
Author: User

MySQL database has a variety of installation methods, this article only describes the most practical and fastest MySQL server installation method on Linux servers.
one, Linux server yum installation (CentOS6.3 64-bit)
All commands executed on the server are behind #
1. command to install MySQL
# yum install MySQL mysql-server mysql-devel-y
Last hint complete! Indicates successful installation

2. See if the MYSQLD service is generated and set up a random start
# chkconfig--list |grep MySQL

Digital code server start level, off for non-random start mysqld service, on for random start service
We need to set mysqld random start, execute the following command to set
# Chkconfig Mysqld on
This result represents a normal
# chkconfig--list |grep MySQL

3. Start Mysqld Service
Execute the following command to start, both methods can:
#/etc/init.d/mysqld Start
# service Mysqld Start

After starting, PS a bit, see if the process is up
# ps-ef |grep mysql|grep-v grep
Root 1582 1 0 23:26 pts/0 00:00:00/bin/sh/usr/bin/mysqld_safe--datadir=/var/lib/mysql--socket=/var/lib/my Sql/mysql.sock--pid-file=/var/run/mysqld/mysqld.pid--basedir=/usr--user=mysql
MySQL 1684 1582 1 23:26 pts/0 00:00:00/usr/libexec/mysqld--basedir=/usr--datadir=/var/lib/mysql- -log-error=/var/log/mysqld.log--pid-file=/var/run/mysqld/mysqld.pid--socket=/var/lib/mysql/mysql.sock
According to the process information can be seen, MySQL database data directory is/var/lib/mysql, error log file is/var/log/mysqld.log

See which libraries are available
# Cd/var/lib/mysql
# ls-l

Found two libraries, all of which are MySQL default, how to create a database manually, will be described in the following tutorial.

View occupied ports, default 3306 ports
# NETSTAT-NUTLP | grep MySQL
TCP 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1684/mysqld

4. Stop MYSQLD Service
Execute the following command to stop, both methods can:
#/etc/init.d/mysqld Stop
# Service Mysqld Stop

5. Restart Mysqld Service
Perform the following command to restart, both methods can:
#/etc/init.d/mysqld Restart
# service Mysqld Srestart

6, command line test connection MySQL, subsequent can directly manage the database in the command line
Direct execution, yum installed MySQL, local root password default is empty
# MySQL

7. Set initial password \ Permissions

Set a new password with the same license limit

Mysql> Grant All on * * to [e-mail protected] '% ' identified by ' Youpassword ';

Refresh to make it effective

mysql> flush Privileges;

Exit

Mysql> exit;

8. Re-login to see if the new password and permissions are in effect mysql> [[email protected]_redhat bin]# mysql-u root-penter Password: ' Enter password for settings '

Linux installation MySQL database--yum installation method

Related Article

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.