Install MySql in Yum and set the password

Source: Internet
Author: User
 
 
Yum install MySQL
Yum install mysql-Server
Yum install mysql-devel
Chgrp-r MySQL/var/lib/MySQL
Chmod-r 770/var/lib/mysqlservice mysqld start
MySQL
Set password for 'root' @ 'localhost' = PASSWORD ('secret _ password ');

Close!

Update

To allow access from other machinesMySQL. UserAddHostIs'%'OfUser, And thenFlush priviledges;Finally, add a statement like this to the firewall (activate3306Port ):

-A RH-Firewall-1-INPUT-M state -- state new-m tcp-p tcp -- dport 3306-J accept

If you wantRebootSelf-starting:

 

Chkconfig -- levels 345 mysqld on

 

 

 

 

 

 

 

Install MySQL using yum in Linux

 

 

The method for installing software in yum is very simple, but first find a better source,
Centos5.3 the default source is good. There are many sources on the Internet.Article,
There are a lot of Google, so I will not introduce it here.
IfSource codeIf compilation is not successful, yum installation is a good choice, especially for beginners,
The installation process is very simple. Just enter Yum-y install mysql-server, and the system automatically downloads and installs MySQL,
Chkconfig -- add mysqld add MySQL service to the service list
Service mysqld Start Service Startup
Mysqladmin-u Root Password 'newpassword' Change Password
Mysql-u root-P mysql> drop database test; Delete the Test Database
Mysql> Delete from mysql. User where user = ''; delete an anonymous account
Mysql> flush privileges; reload Permissions
Add a MySQL user:
Grant all privileges on my_db. * To 'user' @ 'localhost' identified by 'Password ';

 

 

 

From: http://www.zouqingshui.net/headingto3/linux-yum-install-mysql/

 

 

 

 

 

 

 

 

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.