Installation of MySQL 5.6.35 RPM package
Mysql 5.6.35 RPM package installation
I. Remove old RPM packages:
Query rpm -qa| grep -i mysql
Delete if necessary
rpm -ev mysql-libs- --nodeps
rpm -e --nodeps mysql-devel-5.1.73
rpm -e --nodeps mysql-5.1.73*
add--nodeps is a strong delete
Second, in the installation, make sure to disable selinux first and turn off firewall iptables.
disable SELinux
Temporary disable command setenforce 0
permanently disable
Use the text editor to open/etc/selinux/config and change SELINUX=enforcing to SELINUX=disabled.
turn off the firewall
service iptables stop
chkconfig iptables off
Creating MySQL Users
groupadd mysql
useradd -r -g mysql mysql
IV. Installation
Copy MySQL 5.6.35 rpm package to/usr/local
cd /usr/local
rpm -ivh MySQL-shared-5.6.35-1.el6.x86_64.rpm
rpm -ivh MySQL-shared-compat-5.6.35-1.el6.x86_64.rpm
rpm -ivh MySQL-devel-5.6.35-1.el6.x86_64.rpm
rpm -ivh MySQL-client-5.6.35-1.el6.x86_64.rpm
rpm -ivh MySQL-server-5.6.35-1.el6.x86_64.rpm
MySQL-server-5.6.35 RPM package installation, screen prompt, it has been initialized
check
ls -l /var/lib/mysql
5. Edit MySQL's configuration file
vi or gedit /etc/my.cnf
######################################
[client]
default-character-set=utf8
socket=/tmp/mysql.sock
[mysqld]
########basic settings########
character_set_server=utf8
max_connections = 500
datadir = /var/lib/mysql
max_allowed_packet = 16M
lower_case_table_names=1
log-error=/var/log/mysqld.log
socket=/tmp/mysql.sock
default-storage-engine=InnoDB
########replication settings########
server-id =103
log_bin = mysql-bin
sync_binlog = 0
binlog_format = row
expire_logs_days=60
########innodb settings########
innodb_flush_log_at_trx_commit = 2
innodb_buffer_pool_size=128M
innodb_log_buffer_size=16M
innodb_log_file_size=256M
################
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
VI. Start mysql service, there are many ways to start it
start the MySQL
service mysql start
Or/etc/rc.d/init.d/mysql start
(This version of Mysql RPM package installation, automatically added mysql database system services)
Stop mysql
Start with service mysql stop
Start with mysqld script: /etc/rc.d/init.d/mysql stop
mysqladmin shutdown -uroot -p
Where are the relevant directories after MySQL RPM installation? find / -name mysql
/usr/bin: client programs and scripts, commands such as mysqladmin mysqldump mysqld_safe
/usr/sbin: mysqld
/var/lib/mysql: Directory of database
/etc/rc.d/init.d/directory of startup script file mysql, such as/etc/rc.d/init.d/mysqld
7. Change password and create remote root user
#View root account password
cat /root/.mysql_secretmysql -uroot -p
Mysql>
set password=password('123@abc');
grant all privileges on . to root@'%' identified by '123@abc';
flush privileges;