Install MySQL using an rpm package in CentOS

Source: Internet
Author: User

Install MySQL using an rpm package in CentOS

To install MySQL in CentOS:

First, explain

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

2. Install the server:

[Root @ bkjia 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 @ bkjia 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 @ bkjia sean] #/etc/init. d/mysql start or

[Root @ bkjia sean] # mysqld_safe &

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

[Sean @ bkjia ~] $ 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 @ bkjia sean] # ps-e

4. Stop the mysql service:

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

Restart mysql:/etc/init. d/mysql restart

5. After linux is restarted, start the mysql Service

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

[Root @ bkjia 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 @ bkjia mysql] #/usr/bin/mysqladmin-u root password '*****'

Log on to mysql

[Root @ bkjia 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 @ bkjia 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 @ bkjia sean] # rpm-e -- nodeps MySQL-client-5.1.73-1.glibc23.i386

[Root @ bkjia 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 @ bkjia sean] # rm-rf/var/lib/mysql

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

-------------------------------------- Split line --------------------------------------

How to install and configure MySQL5.7.3.0

Install MySQL in Ubuntu 14.04

MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF

Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL

Build a MySQL Master/Slave server in Ubuntu 14.04

Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS

Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04

MySQL-5.5.38 universal binary Installation

-------------------------------------- Split line --------------------------------------

This article permanently updates the link address:

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.