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