Summary on installing mysql with rpm in CentOS
Install MySQL 5.7 at RPM
----------------------- Version 1 centos7 -----------------------
1. Uninstall mariadb. lib
2. sequence: common, lib, client, server (/var/log/mysqld. log password)
3. chown-R mysql: mysql/data/mydata;
Mysqld [-- user = mysql] -- datadir =/data/mydata -- initialize
(Mysqld -- verbose -- help contains various variables and options)
4. vi/etc/my. cnf
5. systemctl start mysqld. service
6. mysql_secure_installation -- user = root -- password = 'dfsfsdf'
----------------------- Version 2 centos6 -------------------------
1. Uninstall other versions of mysql. Use rpm-e MySQL-*** -- nodeps if necessary.
2. sequence: common, lib, client, server (/root/. mysql_secret or/var/log/mysqld. log)
3. chown-R mysql: mysql/data/mysqldata
Mysqld -- user = mysql -- datadir =/data/mysqldata -- initialize
4. vi/etc/my. cnf
5. chkconfig -- add mysqld chkconfig mysqld -- level 35 on
6. mysql_secure_installation -- user = root -- password =
-------------- Password security authentication plug-in -------------
1. show plugins;
2. Add validate_password = off TO mysqld Of my. cnf.
3. Restart mysqld
------------------- Password ---------------------
Set password for 'root' @ localhost = PASSWORD ('chenxing ');
----------------- The problem that the mysql System Log time is later than the system 8 hours ---------------
Set log_timestamps to SYSTEM.
------------------- Other operations ---------------------
1. Authorization: grant select, UPDATE, INSERT, DELETE on *. * to yongfu_a @ 'localhost ';
Cancel authorization: revoke select, UPDATE, INSERT, DELETE on *. * from yongfu_a @ 'localhost ';
2. delete a user: drop user 'root' @ 'localhost ';
3. Add a user: create user 'root' @ "localhost' identified by 'cxx ';
4. set password: set PASSWORD for 'root' @ 'localhost' = password ("cxx ");