#将rpm包上传到/root/work directory (can also be a different directory)
mysql-server-5.6.29-1.linux_glibc2.5.x86_64.rpm
mysql-client-5.6.29-1.linux_glibc2.5.x86_64.rpm
#查看之前是否安装过mysql
Rpm-qa | Grep-i MySQL
#如果安装过, execute this line of code and delete the previously installed MySQL
Rpm-ev--nodeps mysql-libs-5.1.71-1.el6.x86_64
#增加用户组mysql
Groupadd MySQL
#增加用户mysql, join the MySQL user group
Useradd-r-G MySQL MySQL
#安装server
RPM-IVH mysql-server-5.6.29-1.linux_glibc2.5.x86_64.rpm
#安装client
RPM-IVH mysql-client-5.6.29-1.linux_glibc2.5.x86_64.rpm
====mysql5.6 the directory where you installed the ====================================================================
Directorycontents of Directory
/usr/binclient Programs and Scripts
/usr/sbinthe mysqld Server
/var/lib/mysqllog files, databases
/usr/share/infomysql Manual in Info format
/usr/share/manunix manual Pages
/usr/include/mysqlinclude (header) files
/usr/lib/mysqllibraries
/usr/share/mysqlmiscellaneous support files, including error messages, character set files, sample configuration files, SQ L for database Installation
/usr/share/sql-benchbenchmarks
==========================================================================================
#修改my. CNF, default on/USR/MY.CNF
Vim/usr/my.cnf
[Client]
Default-character-set=utf8
[MySQL]
Default-character-set=utf8
[Mysqld]
Character_set_server=utf8
# Basedir = ...
# DataDir = ...
# port = .....
# server_id = ...
# socket = .....
Sql_mode=no_engine_substitution,strict_trans_tables
#将mysqld加入系统服务, and randomly start
Cp/usr/share/mysql/mysql.server/etc/init.d/mysqld
#下面两句不需要!!
#chkconfig--add mysqld
#chkconfig mysqld on
#启动mysqld
Service mysqld Start
#获取mysql安装时root用户的随机密码
Vim/root/.mysql_secret
#必须要修改root用户的密码才可以使用mysql, otherwise only connection cannot operate
mysqladmin-u root-p Password root
#连接进入mysql
Mysql-u root-p
Root
#查看mysql的安装运行路径
Ps-ef|grep MySQL
Linux MySQL rpm installation