Install MySQL Server and MySQL Client in CentOS

Source: Internet
Author: User

1. First, check whether MySQL or mysql has been installed. command:

Rpm-qa | grep MySQL

Rpm-qa | grep mysql

Because the installation is described here, if both mysql-client and mysql-server have been installed, you can directly use it without installing it. Otherwise, you can delete the related programs listed by the above commands. Use rpm-e *** (here, *** indicates the list items)-nodeps (for example, rpm-e MySQL *** -- nodeps)

2. Download two files from http://dev.mysql.com/downloads/mysql/5.7.html:

MySQL-client-5.7.1_m11-2.linux_glibc2.5.i386.rpm

MySQL-server-5.7.1_m11-2.linux_glibc2.5.i386.rpm

(Here 32-bit i386 download, 64-bit download of x86)

3. Install MySQL

Put the above two files in the system/opt/mysql/folder.

Use rpm-ivh/opt/mysql/MySQL-server-5.7.1_m11-2.linux_glibc2.5.i386.rpm

Use rpm-ivh/opt/mysql/MySQL-client-5.7.1_m11-2.linux_glibc2.5.i386.rpm

If the installation progress appears and everything goes smoothly, the installation is generally successful. Otherwise, it may be that the installation is not complete in the first step, and re-check whether the installation is complete.

4. Several errors may occur when you enter/etc/init. d/mysql start by using the command:

1. The previous mysql process is in use. Run the command ps-e | grep mysql.

Run the command kill-9 to check the process ID)

2. If a PID error occurs, or a file like/usr/**/lock. * is prompted, run the rm command to delete the files. If the/*/. pid file appears, the parent file of the file is returned for deletion.

5. Re-Input/etc/init. d/mysql start to indicate that the startup is successful.

Input rpm-qa | grep MySQL (this is the new version). If the output server and client are used, the installation is normal.

Rpm-qa | grep mysql

6. Add the password. Command:/usr/bin/mysqladmin-u root password 'the password you want to add'

For example:/usr/bin/mysqladmin-u root password 'public123'

7. Enter mysql-u root-p next time. Then the system prompts you to enter the password

8. If you have installed mysql and set a password before, a new password will be installed again. You can do this if you forget the root password or do not know the new password. First, service mysqld stop. Then, enter mysqld_safe-skip-grant-tables &. And then mysql-u root. Select use mysql. Finally, update user set password = password ('000000') where user = 'root'; refresh: flush privileges; restart to use the new password.

Recommended reading:

Complete MySQL installation and master-slave dual-machine configuration

Install MySQL database in rpm mode on RHEL6 Platform

RedHat 6.3 MySQL-server-5.6.13-1.el6.x86_64.rpm Installation

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

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.