A, download Linux corresponding three files from the MySQL official website
mysql-server-5.6.30-1.el6.x86_64.rpmmysql-devel-5.6.30-1.el6.x86_64.rpmmysql-client-5.6.30-1.el6.x86_64.rpm
b. Check if MySQL is installed and delete if installed
[Email protected] ~]# Rpm-qa | Grep-i Mysql[[email protected] ~]# yum-y Remove mysql-libs*
C. Install MySQL
[Email protected] rpm]# RPM-IVH mysql-server-5.6.30-1.el6.x86_64.rpm[[email protected] rpm]# RPM-IVH Mysql-devel-5.6.30-1.el6.x86_64.rpm[[email protected] rpm]# RPM-IVH mysql-client-5.6.30-1.el6.x86_64.rpm
D. Modify the location of the MySQL configuration file
[Email protected] rpm]# CP/USR/SHARE/MYSQL/MY-DEFAULT.CNF/ETC/MY.CNF
E, initialize MySQL and set password
[[email protected] rpm]#/usr/bin/mysql_install_db[[email protected] rpm]# service MySQL start# view root account password [email Protected] rpm]# Cat/root/.mysql_secret # The random password set for the root user at Wed Dec one 23:32:50 (loca L time): Ysftyd[[email protected] ~]# Mysql-uroot–ysftyd
#设置密码为root mysql> SET PASSWORD = PASSWORD (' root); mysql> exit [[email protected] ~]# Mysql-uroot-proot
F, Telnet user settings
Mysql> Select Host,user,password from user;+-----------------------+------+------------------------------------ -------+| Host | user | password |+-----------------------+------+-------------------------------------------+| localhost | root | *81f5e21e35407d884a6cd4a731aebfb6af209e1b | | localhost.localdomain | root | * 81f5e21e35407d884a6cd4a731aebfb6af209e1b | | 127.0.0.1 | root | *81f5e21e35407d884a6cd4a731aebfb6af209e1b | |:: 1 | root | * 81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |+-----------------------+------+-------------------------------------- -----+mysql> Update User set Password=password (' 123456 ') where user= ' root ';mysql> update user set host= '% ' where use R= ' root ' and host= ' localhost ';mysql> flush privileges;mysql> exit
G, set boot start
[[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
H, default installation location for MySQL
#数据库目录/var/lib/mysql/#配置文件目录/usr/share/mysql# related command directory/usr/bin# startup script/etc/init.d/mysql
I, modify the character set
[Email protected]/]# vi/etc/my.cnf[client]password=rootport=3306default-character-set=utf8[mysqld]port= 3306character_set_server=utf8character_set_client=utf8collation-server=utf8_general_ci# ( Note 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 Maximum number of connections allowed by the 151,MYSQL server 16384; ) Max_connections=151[mysql]default-character-set = UTF8
J. Remote connection MySQL settings
MySQL is installed and configured to complete
Install MySQL under Linux