[Email protected] ~]# Cd/home/app/mysql
[[email protected] mysql]# ls
--Decompression
Mysql-community-5.1.73-1.rhel5.i386.rpm-bundle.tar
[Email protected] mysql]# TAR-XVF Mysql-community-5.1.73-1.rhel5.i386.rpm-bundle.tar
mysql-test-community-5.1.73-1.rhel5.i386.rpm
mysql-embedded-community-5.1.73-1.rhel5.i386.rpm
mysql-devel-community-5.1.73-1.rhel5.i386.rpm
mysql-shared-compat-5.1.73-1.rhel5.i386.rpm
mysql-shared-community-5.1.73-1.rhel5.i386.rpm
mysql-server-community-5.1.73-1.rhel5.i386.rpm
mysql-client-community-5.1.73-1.rhel5.i386.rpm
mysql-community-debuginfo-5.1.73-1.rhel5.i386.rpm
--Installation
[Email protected] mysql]# RPM-IVH *.rpm
Preparing ... ########################################### [100%]
1:mysql-shared-community ########################################### [13%]
2:mysql-devel-community ########################################### [25%]
3:mysql-client-community ########################################### [38%]
4:mysql-community-debugin########################################### [50%]
5:mysql-embedded-communit########################################### [63%]
6:mysql-server-community ########################################### [75%]
REMEMBER to SET A PASSWORD for the MySQL root USER!
To does so, start the server, then issue the following commands:
/usr/bin/mysqladmin-u root password ' new-password '
/usr/bin/mysqladmin-u root-h hqw.net password ' new-password '
Alternatively you can run:
/usr/bin/mysql_secure_installation
Which would also give you the option of removing the test
Databases and anonymous user created by default. This is
Strongly recommended for production servers.
See the Manual for more instructions.
Problems with The/usr/bin/mysqlbug script!
Starting MySQL. [OK]
Giving mysqld 2 seconds to start
7:mysql-shared-compat ########################################### [88%]
8:mysql-test-community ########################################### [100%]
--Reset root password
[Email protected] mysql]#/usr/bin/mysqladmin-u root-h hqw.net password ' root '
[[email protected] mysql]#/usr/bin/mysqladmin-u root password ' root '
--Start service
[[Email protected] mysql]# service MySQL start
Starting MySQL [OK]
--root Login
[Email protected] mysql]# Mysql-uroot-proot
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 3
Server version:5.1.73-community MySQL Community Server (GPL)
Copyright (c) and/or, Oracle, its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
Mysql> Select Now ();
+---------------------+
| Now () |
+---------------------+
| 2014-11-22 08:01:09 |
+---------------------+
1 row in Set (0.00 sec)
--Create a new remote account
mysql> GRANT All privileges on * * to [email protected] identified by ' test ' with GRANT OPTION;
Query OK, 0 rows Affected (0.00 sec)
mysql> GRANT All privileges on * * to [email protected]"% "identified by ' test ' with GRANT OPTION;
Query OK, 0 rows Affected (0.00 sec)
--Refresh Permissions
mysql> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)
Mysql> exit
--Remote database user Login
[Email protected] mysql]# mysql-utest-ptest
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 4
Server version:5.1.73-community MySQL Community Server (GPL)
Copyright (c) and/or, Oracle, its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
Mysql> Select Now ();
+---------------------+
| Now () |
+---------------------+
| 2014-11-22 08:02:36 |
+---------------------+
1 row in Set (0.00 sec)
Mysql>
Mysql> exit
Bye
[[Email protected] mysql]# exit
Logout
Last Login:sat-07:53:02 from 192.168.11.1
--copy Master configuration file
[Email protected] ~]# CP/USR/SHARE/MYSQL/MY-HUGE.CNF/ETC/MY.CNF
--Add skip-name-resolve to the master profile,skip-grant-tables to speed up remote connections
--change the MySQL configuration file, in my.cnf [Mysqld] under (the position can not be wrong) plus lower_ Case_table_name=1 (1 means case insensitive, 0 case-sensitive), save restart MySQL
[[email protected] ~]# vi/etc/my.cnf
# Example MySQL config file for very large systems.
#
# This was for a large system with memory of 1G-2G where the system runs mainly
# MySQL.
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# can copy this option file to one of those
# locations. For information on these locations, see:
# http://dev.mysql.com/doc/mysql/ en/option-files.html
#
# in the This file, you can use the all long options that a progr AM supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options would be passed to all MySQL clients
[Client]
#password = Your_password
Port = 3306
Socket =/var/lib/mysql/mysql.sock
# here follows entries for some specific programs
# The MySQL server
[Mysqld]
Lower_case_table_name=1
Skip-name-resolve
Skip-grant-tables
Port = 3306
Socket =/var/lib/mysql/mysql.sock
Skip-locking
"/etc/my.cnf" 149L, 4748C written
[Email protected] ~]#
--set firewall to allow Port 3306
[Email protected] ~]# Vi/etc/sysconfig/iptables
# Firewall configuration written by System-config-securitylevel
# Manual Customization of this file are not recommended.
*filter
: INPUT ACCEPT [0:0]
: FORWARD ACCEPT [0:0]
: OUTPUT ACCEPT [0:0]
: Rh-firewall-1-input-[0:0]
-A input-j Rh-firewall-1-input
-A forward-j Rh-firewall-1-input
-A rh-firewall-1-input-i lo-j ACCEPT
-A rh-firewall-1-input-p ICMP--icmp-type any-j ACCEPT
-A rh-firewall-1-input-p 50-j ACCEPT
-A rh-firewall-1-input-p 51-j ACCEPT
-A rh-firewall-1-input-p tcp-m state--state new-m TCP--dport 8080-j ACCEPT
-A rh-firewall-1-input-p tcp-m state--state new-m TCP--dport 1158-j ACCEPT
-A rh-firewall-1-input-p tcp-m state--state new-m TCP--dport 5560-j ACCEPT
-A rh-firewall-1-input-p UDP--dport 5353-d 224.0.0.251-j ACCEPT
-A rh-firewall-1-input-p udp-m UDP--dport 631-j ACCEPT
-A rh-firewall-1-input-p tcp-m tcp--dport 631-j ACCEPT
-A rh-firewall-1-input-m state--state established,related-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 3306-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 1521-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 22-j ACCEPT
"/etc/sysconfig/iptables" 25L, 1275C
# Firewall configuration written by System-config-securitylevel
# Manual Customization of this file are not recommended.
*filter
: INPUT ACCEPT [0:0]
: FORWARD ACCEPT [0:0]
: OUTPUT ACCEPT [0:0]
: Rh-firewall-1-input-[0:0]
-A input-j Rh-firewall-1-input
-A forward-j Rh-firewall-1-input
-A rh-firewall-1-input-i lo-j ACCEPT
-A rh-firewall-1-input-p ICMP--icmp-type any-j ACCEPT
-A rh-firewall-1-input-p 50-j ACCEPT
-A rh-firewall-1-input-p 51-j ACCEPT
-A rh-firewall-1-input-p tcp-m state--state new-m TCP--dport 8080-j ACCEPT
-A rh-firewall-1-input-p tcp-m state--state new-m TCP--dport 1158-j ACCEPT
-A rh-firewall-1-input-p tcp-m state--state new-m TCP--dport 5560-j ACCEPT
-A rh-firewall-1-input-p UDP--dport 5353-d 224.0.0.251-j ACCEPT
-A rh-firewall-1-input-p udp-m UDP--dport 631-j ACCEPT
-A rh-firewall-1-input-p tcp-m tcp--dport 631-j ACCEPT
-A rh-firewall-1-input-m state--state established,related-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 3306-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 1521-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 22-j ACCEPT
-A rh-firewall-1-input-j REJECT--reject-with icmp-host-prohibited
COMMIT
~
~
~
~
~
~
~
~
~
~
~
~
~
"/etc/sysconfig/iptables" 25L, 1275C written
--stop Firewall service
[[email protected] ~]# service iptables stop
Flushing Firewall rules: [ ok ]
Setting chains to policy accept:filter [ ok ]
unloading iptables modules: [ ok ]
--Open Firewall service
[[Email protected] ~]# service iptables start
Applying iptables firewall rules: [OK]
Loading additional iptables modules:ip_conntrack_netbios_n[OK]
[Email protected] ~]#
--View Network configuration
[Email protected] ~]# ifconfig
Eth0 Link encap:ethernet HWaddr 00:0c:29:0d:b0:9d
inet addr:192.168.11.6 bcast:192.168.11.255 mask:255.255.255.0
Inet6 ADDR:FE80::20C:29FF:FE0D:B09D/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:121089 errors:0 dropped:0 overruns:0 frame:0
TX packets:65139 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:169113515 (161.2 MiB) TX bytes:5457976 (5.2 MiB)
interrupt:67 Base address:0x2000
Lo Link encap:local Loopback
inet addr:127.0.0.1 mask:255.0.0.0
Inet6 addr::: 1/128 scope:host
Up LOOPBACK RUNNING mtu:16436 metric:1
RX packets:7086 errors:0 dropped:0 overruns:0 frame:0
TX packets:7086 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4800365 (4.5 MiB) TX bytes:4800365 (4.5 MiB)
--Remote connection
REDHAT5 installation Mysql5.1.7