Install MySql in Linux (Virtual Machine)

Source: Internet
Author: User

[Root @ localhost Home] # tar-xvf MySQL-5.6.2_m5-1.rhel5.i386.tar
MySQL-client-5.6.2_m5-1.rhel5.i386.rpm
MySQL-devel-5.6.2_m5-1.rhel5.i386.rpm
MySQL-embedded-5.6.2_m5-1.rhel5.i386.rpm
MySQL-server-5.6.2_m5-1.rhel5.i386.rpm
MySQL-shared-5.6.2_m5-1.rhel5.i386.rpm
MySQL-test-5.6.2_m5-1.rhel5.i386.rpm
[Root @ localhost Home] # ls
Admin
Lost + found
MySQL-5.6.2_m5-1.rhel5.i386.tar
MySQL-client-5.6.2_m5-1.rhel5.i386.rpm
MySQL-devel-5.6.2_m5-1.rhel5.i386.rpm
MySQL-embedded-5.6.2_m5-1.rhel5.i386.rpm
MySQL-server-5.6.2_m5-1.rhel5.i386.rpm
MySQL-shared-5.6.2_m5-1.rhel5.i386.rpm
MySQL-test-5.6.2_m5-1.rhel5.i386.rpm
Vmware-tools-distrib
[Root @ localhost Home] # rpm-IVH MySQL-server-5.6.2_m5-1.rhel5.i386.rpm
Error: Failed dependencies:
MySQL conflicts with mysql-5.0.77-4.el5_4.2.i386
Mysql-server conflicts with mysql-server-5.0.77-4.el5_4.2.i386
[Root @ localhost Home] # rpm-Qa | grep-I MySQL
Mysql-5.0.77-4.el5_4.2
MySQL-python-1.2.1-1
Mysql-connector-odbc-3.51.26r1127-1.el5
Perl-DBD-MySQL-3.0007-2.el5
Mysql-server-5.0.77-4.el5_4.2
Libdbi-dbd-mysql-0.8.1a-1.2.2
[Root @ localhost Home] # rpm-ev libdbi-dbd-mysql-0.8.1a-1.2.2
[Root @ localhost Home] # rpm-Qa | grep-I MySQL
Mysql-5.0.77-4.el5_4.2
MySQL-python-1.2.1-1
Mysql-connector-odbc-3.51.26r1127-1.el5
Perl-DBD-MySQL-3.0007-2.el5
Mysql-server-5.0.77-4.el5_4.2
[Root @ localhost Home] # rpm-ev mysql-server-5.0.77-4.el5_4.2
[Root @ localhost Home] # rpm-Qa | grep-I MySQL
Mysql-5.0.77-4.el5_4.2
MySQL-python-1.2.1-1
Mysql-connector-odbc-3.51.26r1127-1.el5
Perl-DBD-MySQL-3.0007-2.el5
[Root @ localhost Home] # rpm-ev perl-DBD-MySQL-3.0007-2.el5
[Root @ localhost Home] # rpm-Qa | grep-I MySQL
Mysql-5.0.77-4.el5_4.2
MySQL-python-1.2.1-1
Mysql-connector-odbc-3.51.26r1127-1.el5
[Root @ localhost Home] # rpm-ev mysql-connector-odbc-3.51.26r1127-1.el5
[Root @ localhost Home] # rpm-Qa | grep-I MySQL
Mysql-5.0.77-4.el5_4.2
MySQL-python-1.2.1-1
[Root @ localhost Home] # rpm-ev MySQL-python-1.2.1-1
[Root @ localhost Home] # rpm-Qa | grep-I MySQL
Mysql-5.0.77-4.el5_4.2
[Root @ localhost Home] # rpm-ev mysql-5.0.77-4.el5_4.2
[Root @ localhost Home] # rpm-ev mysql-5.0.77-4.el5_4.2
Error: Package mysql-5.0.77-4.el5_4.2 Is Not Installed
[Root @ localhost Home] # rpm-Qa | grep-I MySQL
[Root @ localhost Home] # rm-F/etc/My. CNF
[Root @ localhost Home] # rm-RF/var/lib/MySQL
[Root @ localhost Home] # ls
Admin lost + found MySQL-devel-5.6.2_m5-1.rhel5.i386.rpm MySQL-server-5.6.2_m5-1.rhel5.i386.rpm
MySQL-test-5.6.2_m5-1.rhel5.i386.rpm
Centos MySQL-client-5.6.2_m5-1.rhel5.i386.rpm MySQL-embedded-5.6.2_m5-1.rhel5.i386.rpm MySQL-shared-5.6.2_m5-1.rhel5.i386.rpm
Vmware-tools-distrib
[Root @ localhost Home] # rpm-IVH MySQL-server-5.6.2_m5-1.rhel5.i386.rpm
Preparing... ######################################## ### [100%]
1: mysql-server ##################################### ###### [100%]
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 localhost password 'new-password'

Alternatively you can run:
/Usr/bin/mysql_secure_installation

Which will also give you the option of removing the test
Databases and anonymous user created by default. This is
Stronugly recommended for production servers.

See the manual for more instructions.

Please report any problems with the/usr/bin/mysqlbug script!
[Root @ localhost Home] # ls
Admin lost + found MySQL-devel-5.6.2_m5-1.rhel5.i386.rpm MySQL-server-5.6.2_m5-1.rhel5.i386.rpm

MySQL-test-5.6.2_m5-1.rhel5.i386.rpm
Centos MySQL-client-5.6.2_m5-1.rhel5.i386.rpm MySQL-embedded-5.6.2_m5-1.rhel5.i386.rpm MySQL-shared-5.6.2_m5-1.rhel5.i386.rpm

Vmware-tools-distrib
[Root @ localhost Home] # rpm-IVH MySQL-client-5.6.2_m5-1.rhel5.i386.rpm
Preparing... ######################################## ### [100%]
1: mysql-client ##################################### ###### [100%]
[Root @ localhost Home] # rpm-IVH MySQL-devel-5.6.2_m5-1.rhel5.i386.rpm
Preparing... ######################################## ### [100%]
1: mysql-devel ##################################### ###### [100%]
[Root @ localhost Home] # netstat-antp
Active Internet connections (servers and established)
PROTO Recv-Q send-Q local address foreign address State PID/program name
TCP 0 0 127.0.0.1: 2208 0.0.0.0: * Listen 3649/hpiod
TCP 0 0 0.0.0.0: 648 0.0.0.0: * Listen 3434/rpc. statd
TCP 0 0 0.0.0.0: 111 0.0.0.0: * Listen 3402/Portmap
TCP 0 0 127.0.0.1: 631 0.0.0.0: * Listen 2954/cupsd
TCP 0 0 127.0.0.1: 25 0.0.0.0: * Listen 3689/sendmail: acce
TCP 0 0 127.0.0.1: 2207 0.0.0.0: * Listen 3654/Python
TCP 0 0: 22: * Listen 3667/sshd
TCP 0 0: FFFF: 192.168.184.136: 22: FFFF: 192.168.184.1: 1385 established 4107/sshd: root @ not
TCP 0 0: FFFF: 192.168.184.136: 22: FFFF: 192.168.184.1: 1382 established 4020/1
[Root @ localhost Home] #/etc/init. d/MySQL start
Starting MySQL... [OK]
[Root @ localhost Home] # netstat-antp
Active Internet connections (servers and established)
PROTO Recv-Q send-Q local address foreign address State PID/program name
TCP 0 0 127.0.0.1: 2208 0.0.0.0: * Listen 3649/hpiod
TCP 0 0 0.0.0.0: 648 0.0.0.0: * Listen 3434/rpc. statd
TCP 0 0 0.0.0.0: 111 0.0.0.0: * Listen 3402/Portmap
TCP 0 0 127.0.0.1: 631 0.0.0.0: * Listen 2954/cupsd
TCP 0 0 127.0.0.1: 25 0.0.0.0: * Listen 3689/sendmail: acce
TCP 0 0 127.0.0.1: 2207 0.0.0.0: * Listen 3654/Python
TCP 0 0: 3306: * Listen 5952/mysqld
TCP 0 0: 22: * Listen 3667/sshd
TCP 0 0: FFFF: 192.168.184.136: 22: FFFF: 192.168.184.1: 1385 established 4107/sshd: root @ not
TCP 0 144: FFFF: 192.168.184.136: 22: FFFF: 192.168.184.1: 1382 established 4020/1
[Root @ localhost Home] # MySQL
Welcome to the MySQL monitor. commands end with; or/g.
Your MySQL connection ID is 1
Server version: 5.6.2-M5 MySQL Community Server (GPL)

Copyright (c) 2000,201 0, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.

Type 'help; 'or'/H' for help. type'/C' to clear the current input statement.

Mysql> quit
Bye
[Root @ localhost Home] #/usr/bin/mysqladmin-u Root Password 123456
[Root @ localhost Home] # mysql-u root-P
Enter password:
Welcome to the MySQL monitor. commands end with; or \ G.
Your MySQL connection ID is 5
Server version: 5.5.16 MySQL Community Server (GPL)

Copyright (c) 2000,201 1, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.

Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.

Mysql> quit
Bye

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.