Install Mysql5.1.7 _ MySQL in RedHat5

Source: Internet
Author: User
[Root @ hqw ~] Cdhomeappmysql [root @ hqwmysql] ls -- unzip the MySQL-community-5173-1rhel5i386rpm-bundletar [root @ hqwmysql] tar-xvfMySQL-community-5173-1rhel5i386rpm-bundle
[Root @ hqw ~] # Cd/home/app/mysql [root @ hqw mysql] # ls--decompress mysql-community-5.1.73-1.rhel5.i386.rpm-bundle.tar [root @ hqw mysql] # tar-xvf MySQL-community-5.1.73-1.rhel5.i386.rpm-bundle.tarMySQL-test-community-5.1.73-1.rhel5.i386.rpmMySQL-embedded-community-5.1.73-1.rhel5.i386.rpmMySQL-devel-community-5.1.73-1.rhel5.i386.rpmMySQL-shared-compat-5.1.73-1.rhel5.i386.rpmMySQL-shared-community-5.1.73-1.rhel5.i386.rpmMySQ L-server-community-5.1.73-1.rhel5.i386.rpmMySQL-client-community-5.1.73-1.rhel5.i386.rpmMySQL-community-debuginfo-5.1.73-1.rhel5.i386.rpm -- Install [root @ hqw mysql] # rpm-ivh *. rpmPreparing... ######################################## ### [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%] please remember to set a password for the MySQL root USER! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin-u root password 'new-password'/usr/bin/mysqladmin-u root-h hq1_net password' new-password' Alternatively you can run: /usr/bin/mysql_secure_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default. this isstronugly recommended for production servers. see the ma Nual for more instructions. Please report any problems with the/usr/bin/mysqlbug script! Starting MySQL .. [OK] Giving mysqld 2 seconds to start7: mySQL-shared-compat ################################### ######## [88%] 8: mySQL-test-community ################################### ######## [100%] -- reset the root password [root @ hqw mysql] #/usr/bin/mysqladmin-u root-h hq1_net password 'root' [root @ hqw mysql] #/usr/bin/mysqladmin-u root password 'root' -- start the service [root @ hqw mysql] # service mysql startStarting MySQL [OK] -- log on to [root @ hqw mysql] # mysql-uroot-prootWelcome 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) 2000,201 3, Oracle and/or its affiliates. all rights reserved. oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. other names may be trademarks of their respectiveow Ners. type 'help; 'or' \ H' for help. type '\ C' to clear the current input statement. mysql> select now (); + --------------------- + | now () | + ------------------- + | 08:01:09 | + --------------------- + 1 row in set (0.00 sec) -- create a remote account mysql> grant all privileges on *. * TO test @ localhost identified by 'test' with grant option; Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON *. * Test @ "%" identified by 'test' with grant option; Query OK, 0 rows affected (0.00 sec) -- refresh permission mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> exit -- log on to [root @ hqw mysql] # mysql-utest-ptestWelcome 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) 2000,201 3, Oracle and/or its Affiliates. all rights reserved. oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. other names may be trademarks of their respectiveowners. type 'help; 'or' \ H' for help. type '\ C' to clear the current input statement. mysql> select now (); + --------------------- + | now () | + ------------------- + | 08:02:36 | + --------------------- + 1 row in set (0.00 sec) mysql> ExitBye [root @ hqw mysql] # exitlogoutLast login: Sat Nov 22 07:53:02 2014 from 192.168.11.1 -- copy the main configuration file [root @ hqw ~] # Cp/usr/share/mysql/my-huge.cnf/etc/my. cnf -- add skip-name-resolve to the master configuration file, and skip-grant-tables to speed up remote connection -- modify the mysql configuration file, in my. add lower_case_table_name = 1 under [mysqld] in cnf (location cannot be wrong), save and restart mysql [root @ hqw ~] # Vi/etc/my. cnf # Example MySQL config file for very large systems. # This is 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. # You can copy this option file to one of those # locations. for information about these locations, see :# http://dev.mysql.com/doc/mysql/en/option-files.html## In this file, you can use all long options that a program supports. # If you want to know which options a program supports, run the program # with the "-- help" option. # The following options will be passed to all MySQL clients [client] # password = your_passwordport = 3306 socket =/var/lib/mysql. sock # Here follows entries for some specific programs # The MySQL server [mysqld] lower_case_table_name = 1 s Kip-name-resolveskip-grant-tablesport = 3306 socket =/var/lib/mysql. sockskip-locking "/etc/my. cnf "149L, 4748C written [root @ hqw ~] # -- Set the firewall to allow port 3306 [root @ hqw ~] # Vi/etc/sysconfig/iptables # Firewall configuration written by system-config-securitylevel # Manual customization of this file is 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 ACCEPT-A-p 51-j RH-Firewall-1-INPUT ACCEPT-A-p tcp-m state -- state NEW-m tcp -- dport 8080-j 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.20.- j ACCEPT-A RH-Firewall-1-IN PUT-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 AC CEPT "/etc/sysconfig/iptables" 25L, 1275C # Firewall configuration written by system-config-securitylevel # Manual customization of this file is 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 Y-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.20.- 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 -- d Port 22-j ACCEPT-A RH-Firewall-1-INPUT-j REJECT -- reject-with icmp-host-prohibitedCOMMIT ~~~~~~~~~~~~~ "/Etc/sysconfig/iptables" 25L, 1275C written -- stop the Firewall Service [root @ hqw ~] # Service iptables stopFlushing firewall rules: [OK] Setting chains to policy ACCEPT: filter [OK] Unloading iptables modules: [OK] -- enable the firewall service [root @ hqw ~] # Service iptables startApplying iptables firewall rules: [OK] Loading additional iptables modules: ip_conntrack_netbios_n [OK] [root @ hqw ~] # -- View network configuration [root @ hqw ~] # Ifconfigeth0 Link encap: Ethernet HWaddr 00: 0C: 29: 0D: B0: 9 Dinet addr: 192.168.11.6 Bcast: 192.168.11.255 Mask: 255.255.0inet6 addr: fe80: 20c: 29ff: fe0d: b09d/64 Scope: LinkUP broadcast running multicast mtu: 1500 Metric: 1RX packets: 121089 errors: 0 dropped: 0 overruns: 0 frame: 0TX packets: 65139 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000RX bytes: 169113515 (161.2 MiB) TX bytes: 5457976 (5.2 MiB) Interrupt: 67 Base address: 0x2000lo Link encap: local Loopbackinet addr: 127.0.0.1 Mask: 255.0.0.0inet6 addr: 1/128 Scope: HostUP loopback running mtu: 16436 Metric: 1RX packets: 7086 errors: 0 dropped: 0 overruns: 0 frame: 0TX packets: 7086 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 0RX bytes: 4800365 (4.5 MiB) TX bytes: 4800365 (4.5 MiB) -- remote connection

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.