Yum installs MySQL, MySQL code modification (utf-8), and MySQL access to other machine IP and permissions limits

Source: Internet
Author: User
Tags mysql code

One: Install MySQL1. Check if MySQL and install.

Rpm-qa | grep mysql//This command will check if the MySQL database is already installed on the operating system
RPM-E MySQL//normal Delete mode
Rpm-e–nodeps mysql//Brute Force Delete mode, if you use the above command to delete, prompted to have other dependent files, then use this command can be strongly deleted
PS: After the deletion we can pass Rpm-qa | grep mysql command to see if MySQL has been uninstalled successfully!!

2. Yum install MySQL

Yum List | grep MySQL//view the downloadable version of the MySQL database available on Yum
Yum install-y mysql-server mysql mysql-devel//install MySQL mysql-server mysql-devel

3. Start and stop MySQL

Service Mysqld Start/stop/restart

4. Modify the password of the default MySQL root user

/usr/bin/mysqladmin-u root password ' new-password '//Set password for root account

Two: MySQL code modification (utf-8)1. Modify the configuration file

VI/ETC/MY.CNF//Edit the master configuration file for MySQL. If not, go to/usr/share/mysql copy one (MY-MEDIUM.CNF) can

[Client]
Default-character-set=utf8
[Mysqld]
Collation-server = Utf8_unicode_ci
init-connect= ' SET NAMES UTF8 '
Character-set-server=utf8

2. Verify that our code is changed

Mysql>show VARIABLES like ' character% ';
Mysql>show variables like ' collation% ';


Three: MySQL's authorization1. About this kind of stuff, just go to Google under the relevant article to see it OK.

http://jiony.iteye.com/blog/1672912
http://cnzxp521.iteye.com/blog/1332876
http://freeloda.blog.51cto.com/2033581/1253898

2. The specific

GRANT all privileges on . To ' root ' @ ' 192.168.15.115 ' identified by ' 123 ' with Grant option;//authorization
GRANT all privileges on . To ' root ' @ ' 192.168.15.% ' identified by ' 123 ' with Grant option;//authorization
Revoke alter on . from ' root ' @ ' 192.168.15.115 ' identified by ' 123 ';//Cancel Authorization
FLUSH privileges; Refresh

Yum installs MySQL, MySQL code modification (utf-8), and MySQL access to other machine IP and permissions limits

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.