Install mysql using an rpm package in centos

Source: Internet
Author: User

Install mysql using an rpm package in centos

Steps for installing mysql:

First,Http://www.mysql.com/downloads/mysql-4.0.htmlDownload MySQL-client-5.0.96-1.glibc23.x86_64.rpm and

MySQL-server-5.0.96-1.glibc23.x86_64.rpm

Second,Install Server:

[Root @ lfl01 mysql] # rpm-ivh MySQL-server-5.1.73-1.glibc23.i386.rpm

Display Information:

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:
.....
Please report any problems with the/usr/bin/mysqlbug script!

If the preceding information is displayed, the server is successfully installed.

Install the client: [Root @ lfl01 mysql] # rpm-ivh MySQL-client-5.1.73-1.glibc23.i386.rpm

If the following information is displayed, the installation is successful:

Preparing... ######################################## ### [100%]
1: mySQL-client ##################################### ###### [100%]


If this error is reported during installation !!!

File/usr/share/mysql/czech/errmsg. sys from install of MySQL-server-5.1.73-1.glibc.i386 conflicts with file from package mysql-libs-5.1.73-1.glibc.i386

Cause: There is a library for the mysql-libs-5.1.73-1.glibc.i386 (this is built-in for linux) So you need to delete the previous library to install

Rpm-e mysql-libs-5.1.73-1.glibc.i386 -- nodeps force uninstall!

3. Start the mysql Service

[Root @ lfl01 sean] #/usr/init. d/mysql start or

[Root @ lfl01 sean] # mysqld_safe &

Run the netstat command to check whether mysql is successfully started.

[Sean @ lfl01 ~] $ Netstat-nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
Tcp 0 0 0.0.0.0: 3306 0.0.0.0: * LISTEN
Tcp 0 0 0.0.0.0: 22 0.0.0.0: * LISTEN
Tcp 0 0 127.0.0.1: 631 0.0.0.0: * LISTEN
Tcp 0 0 127.0.0.1: 6010 0.0.0.0: * LISTEN
Tcp 0 52 192.168.1.128: 22 192.168.1.106: 51488 ESTABLISHED
Tcp 1 0 192.168.1.128: 38414 23.20..57: 80 CLOSE_WAIT
Tcp 0 0: 22: * LISTEN
Tcp 0 0: 1: 631: * LISTEN
Tcp 0 0: 1: 6010: * LISTEN

The default port number of mysql is 3306. If the port number 3306 is displayed in the preceding information, it is started successfully.

View the mysql process:

[Root @ lfl01 sean] # ps-e

4. Stop the mysql service:

[Root @ lfl01 sean] #/usr/bin/mysqladmin-u root-p shutdown

5. After linux is restarted, start the mysql Service

[Root @ lfl01 sean] #/usr/init. d/mysql start

[Root @ lfl01 mysql] # mysql
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 1
Server version: 5.1.73 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 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.

Exit mysql:

Mysql> exit

Set mysql password

[Root @ lfl01 mysql] #/usr/bin/mysqladmin-u root password '*****'

Log on to mysql

[Root @ lfl01 mysql] # mysql-u root-p
Enter password:
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 3
Server version: 5.1.73 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 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.

If the preceding information is displayed, the logon is successful !!!


Sixth, uninstall mysql

Uninstall with rpm package:

[Root @ lfl01 sean] # rpm-qa | grep MySQL
MySQL-client-5.1.73-1.glibc23.i386
MySQL-server-5.1.73-1.glibc23.i386

Run this command to uninstall the [root @ lfl01 sean] # rpm-e -- nodeps MySQL-client-5.1.73-1.glibc23.i386

[Root @ lfl01 sean] # find/-name mysql
/Var/lib/mysql
/Var/lib/mysql
/Var/lock/subsys/mysql
/Usr/lib/mysql
/Usr/share/mysql
/Usr/mysql
/Usr/bin/mysql
/Etc/logrotate. d/mysql
/Etc/rc. d/init. d/mysql

You can manually delete mysql-related files.

[Root @ lfl01 sean] # rm-rf/var/lib/mysql

The subsequent operations on mysql are the same as those on windows...




 


Related Article

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.