How to deploy and install MySQL under Linux-rpm

Source: Internet
Author: User

RPM Mode installation MySQL5.6

A. Check MySQL and related RPM packages, if installed, remove (rpm–e name)

  

[Email protected] ~]# Rpm-qa | Grep-i Mysqlmysql-libs-5.1.66-2.el6_3.x86_64[[email protected] ~]# yum-y Remove mysql-libs*

b. Download the corresponding RPM package for Linux, such as: centos6.4_64 corresponding RPM package, as follows:

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

[Email protected] rpm]# lltotal 74364-rw-r--r--. 1 root root 18442536 Dec 20:19 mysql-client-5.6.15-1.el6.x86_64.rpm-rw-r--r--. 1 root root 3340660 Dec 20:06 mysql-devel-5.6.15-1.el6.x86_64.rpm-rw-r--r--. 1 root root 54360600 Dec 20:03 mysql-server-5.6.15-1.el6.x86_64.rpm

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

C. Install MySQL

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

[Email protected] rpm]# RPM-IVH mysql-server-5.6.15-1.el6.x86_64.rpm[[email protected] rpm]# RPM-IVH Mysql-devel-5.6.15-1.el6.x86_64.rpm[[email protected] rpm]# RPM-IVH mysql-client-5.6.15-1.el6.x86_64.rpm# Modify the configuration file location [ [Email protected] rpm]# CP/USR/SHARE/MYSQL/MY-DEFAULT.CNF/ETC/MY.CNF

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

D. Initializing MySQL and setting passwords

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

[[email  protected] rpm]# /usr/bin/mysql_install_db[[email protected] rpm]# service  mysql start[[email protected] rpm]# cat /root/.mysql_secret  # View root account password # the random password set for the root user at wed  Dec 11 23:32:50 2013  (Local time):  qktafznl[[email protected] ~] # mysql -uroot –pqktafznlmysql> set password = password (' 123456 ');      #设置密码为123456mysql > exit[[email protected] ~]# mysql -uroot  -p123456 

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

E. Allow remote login

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

mysql> use mysql;mysql> select host,user,password from user;+------------- ----------+------+-------------------------------------------+| host                   | user | password                                    |+------------------ -----+------+-------------------------------------------+| localhost              | root | *6bb4837eb74329105ee4568dda7dc67ed2ca2ad9  | |  localhost.localdomain | root | *1237e2ce819c427b0d8174456dd83c47480d37e8 | |  127.0.0.1             | root  | *1237e2ce819c427b0d8174456dd83c47480d37e8 | |  ::1                    | root | *1237e2ce819c427b0d8174456dd83c47480d37e8 |+------------------- ----+------+-------------------------------------------+ mysql> update user set  Password=password (' 123456 ')  where user= ' root '; mysql> update user set host= '% '  where user= ' root '  and host= ' localhost ';mysql> flush privileges;mysql>  exit

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

F. Setting up boot from

[[email protected] ~]# chkconfig mysql on[[email protected] ~]# chkconfig--list | grep mysqlmysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off

G. Default installation location for MySQL

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

/var/lib/mysql/#数据库目录/usr/share/mysql #配置文件目录/usr/bin #相关命令目录/etc/init.d/m Ysql #启动脚本

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

modifying character set and data store paths

Configure The/etc/my.cnf file, modify the data storage path, themysql.sock path, and the default encoding utf-8.

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

password        = 123456
port            = 3306
DEFAULT-CHARACTER-SET=UTF8
[mysqld]
character_set_server=utf8
CHARACTER_SET_CLIENT=UTF8
collation-server=utf8_general_ci
# (Note that Linux is the default after MySQL is installed: Table names are case-sensitive, column names are case-insensitive; 0: Case-sensitive, 1: Case insensitive)
lower_case_table _NAMES=1
# (Sets the maximum number of connections, the default is the maximum number of connections allowed by the 151,MYSQL server 16384;)
max_connections=1000
[mysql]
default-character-set = UTF8

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

View character Sets

Show variables like '%collation% ';

Show variables like '%char% ';


How to deploy and install MySQL under Linux-rpm

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.