CentOS 6 MySQL Installation configuration authorization

Source: Internet
Author: User

Data installation Configuration
Upload mysql-community-release-el6-5.noarch.rpm Package
Ensure database version is consistent
Installing RPM Packages
The address and package name of the RPM-IVH package. rpm
Yum Update
Installing Mysql-server
Yum-y Install Mysql-server
Start MySQL
Service mysqld Start
Set boot up
Chkconfig mysqld on
Set Password

#/usr/bin/mysql_secure_installation

Change the root password? [y/n] y <– whether to replace the root user password, enter Y and return, it is strongly recommended to replace
New Password: <– Set the root user's password
Re-enter new password: <– Enter the password you set again

Remove anonymous users? [y/n] y <– whether to delete anonymous users, production environment is recommended to delete, so enter Y and return
... success!

Disallow Root login remotely? [y/n] Y <– whether to prohibit root remote login, according to their own needs to choose y/n and enter, it is recommended to prohibit
... success!

Remove test database and access to it? [y/n] y <– whether to delete test database, enter Y and return


#mysql-U root-p

Mysql>select User,host,password from Mysql.user;
Create a database user and user password
Mysql>create user ' username ' @ '% (% for so IP address) ' identified by ' password ';
Create a database
Mysql>create datebases database name;

Authorization to database User (database, user name, user password)
Grant all privileges the on database (x represents all). * to ' username ' @ '% ' identified by ' user password ';

Insert into Mysql.user (Host,user,password) VALUES ("%", "DBA", Password ("123456"));

Grant all privileges on * * to ' DBA ' @ ' percent ' identified by ' 123456 ';
Update Permissions Table
Flush privileges;
Exit
Exit
Upload iptables to/etc/sysconfig/file
Start the firewall
#/etc/init.d/iptables start
#查看启动的端口
#/etc/init.d/iptables status
Backup command
Mysqldump-p3306-hip address-u user name-p password--default-character-set=utf8--opt database name > Save path and name. sql
Restore DATABASE Commands
Mysqldump-p3306-hip address-u user name-p password database name < save path and name. sql
Remote CP command
Scp-p Target Machine Port user name @ip Address: path and package name local path on the target machine

CentOS 6 MySQL Installation configuration authorization

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.