The previous projects were all deployed under the Windows System environment, this time trying to deploy in a Linux system environment, so this time we have installed JDK on 7 hosts, Maven, JBoss One of the installed MySQL, and the LAN configuration, and finally finished. Below will install the steps to share with you!
system version: centos6.3-i386 32-bit operating system
hardware configuration : Kernel Intel (R) Pentium (r) 4 CPU 3.00GHz Memory 998.5M
installation Environment : using shell commands
This installs in the desktop environment, installs with the shell command, the download installs the package to be:
Mysql-5.6.25-1.linux_glibc2.5.i386.rpm-bundle.tar;
A. Check MySQL and related RPM packages, if installed, remove (rpm–e name)
grep -i mysqlmysql-libs-5.1. 2yum -y remove mysql-libs*
B. Select the RPM package for Linux, as follows:
[email protected] rpm]# lltotal74364-rw-r--r--.1Root root18442536Dec One -: +mysql-client-5.6. the-1. el6.x86_64.rpm-rw-r--r--.1Root root3340660Dec One -: .mysql-devel-5.6. the-1. el6.x86_64.rpm-rw-r--r--.1Root root54360600Dec One -:Genevamysql-server-5.6. the-1. el6.x86_64.rpm
C. Install MySQL
[Email protected] rpm]# RPM-IVH mysql-server-5.6. 1-ivh mysql-devel-5.6. 1-ivh mysql-client-5.6. 1CP /USR/SHARE/MYSQL/MY-DEFAULT.CNF/ETC/MY.CNF
D. Initializing MySQL and setting passwords
[Email protected] rpm]#/usr/bin/Mysql_install_db[[email protected] rpm]# service MySQL start[[email protected] rpm]#Cat/root/. Mysql_secret #查看root账号密码 # The random password set forThe root user at Wed Dec One at: +: - -(Local Time): Qktafznl[[email protected]~]# MySQL-Uroot–pqktafznlmysql> SET PASSWORD = PASSWORD ('123456'); #设置密码为123456mysql>Exit[[email protected]~]# mysql-uroot-p123456
E. Remote login user settings
Mysql>Use mysql;mysql>SelectHost,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
F. Setting up boot from
[[Email protected] ~grep mysqlmysql 0: Off 1: Off 2 : On 3: On 4: On 5: On 6: Off
G. Default installation location for MySQL
/var/lib/mysql/ #数据库目录/usr/share/mysql #配置文件目录/usr/bin #相关命令目录 /etc/init.d/mysql #启动脚本
H. 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.
[Client] Password=123456Port=3306default-character-set=UTF8 [mysqld] Port=3306Character_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# (set maximum number of connections, default =151, the maximum number of connections allowed by the MySQL server is 16384;) Max_connections= +[MySQL] default-character-set = UTF8
To view character sets
' %collation% ' ; ' %char% '
I. If you want to log in to MySQL remotely, you need to: authorize and turn off the firewall.
1. Authorization; Enter MySQL on the server and enter the following command
' Root '@'%' Here is your password ' with GRANT
OR
' Root '@'%' ' with GRANT OPTION;]
The difference is whether you need to write a password when accessing it.
The function of this sentence is to set all the user name, can be remotely access all the MySQL table, if you do not want to let go, you can set according to this rule. Grant permissions 1, permissions 2,... Permissions n on the database name. Table name to User name @ user address identified by ' password '.
2. Turn off the firewall
Service iptables stop shutdown Command chkconfig iptables off permanently shuts down the firewall
Two commands run at the same time, check the firewall shutdown state after the run is complete
Here, MySQL is installed and configured successfully.
Reprinted from: http://www.centoscn.com/mysql/2015/0624/5729.html
CentOS under RPM mode installation MySQL5.6 (reprint)