Linux MySQL rpm installation

Source: Internet
Author: User

#将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

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.