Uninstall and install MySQL [rpm package] in Linux

Source: Internet
Author: User

1. Uninstall the original mysql:

Uninstall 1:
Input:
# Rpm-qa | grep-I mysql
Display:
Mysql-libs-5.1.52-1.el6_0.1.i686
Uninstall method:
Yum-y remove mysql-libs-5.1.52-1.el6_0.1.i686

Uninstall 2:
Input:
# Rpm-qa | grep-I mysql
Display:
MySQL-client-5.1.62-1.glibc23.i386
MySQL-server-5.1.62-1.glibc23.i386
Uninstall method:
# Rpm-ev MySQL-client-5.1.62-1.glibc23.i386 MySQL-server-5.1.62-1.glibc23.i386

Ii. Install the MySQL server:
Installation: MySQL-server-5.1.62-1.glibc23.i386.rpm
# Rpm-ivh/software/mysql/MySQL-server-5.1.62-1.glibc23.i386.rpm
This is generating some files under the/usr/share/mysql directory, with a file named: my-medium.cnf to copy it to/etc/my. cnf
# Cp/usr/share/mysql/my-medium.cnf/etc/my. cnf
Now the installation is complete. You can check the running process:
# Ps-ef | grep mysql

3. Install the MySQL client:
# Rpm-ivh/software/mysql/MySQL-client-5.1.62-1.glibc23.i386.rpm
Now the client is successfully installed. You can check some MySQL files:
# Ls/usr/bin/mysql *

4. log on to mysql:
There is no password at the beginning of mysql installation. Enter:
# Mysql
You can log on to the mysql database.

5. Set the MySQL password:
# Mysqladmin-u root password 123456
In this way, set the username in mysql as the root password to 123456.

6. log on to mysql with a password:
The command is the same as logging on to mysql under dos:
# Mysql-uroot-p123456
Or
# Mysql-uroot-p [Press enter]
Enter the password again.

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.