Server database setup process (CENTOS+MYSQL)

Source: Internet
Author: User

Preface :

Database building on the server need to know the version of the Linux system, the previous Ubuntu14.04 directly under the terminal to enter the Apt-get install (package) can easily download and install MySQL, but on the CentOS is not feasible, requires complex configuration, However, in CentOS you can use the Yum install mysql-server mysql-client command can be installed quickly, but this is the 5.1 version of MySQL, does not support more than 5.5 rich features. And in the project development, the project team production environment and test environment for version control has strict requirements, if the inconsistency is very prone to incompatibility and other difficult to resolve errors, so here, I choose to use the Oracle official network directly download the package (RPM), and then installed under the terminal. This method is more general ~ ~

The specific installation process is as follows: (record only for better sharing)

1, first download the MySQL installation package, there are several sites as a reference:
http://dev.mysql.com/downloads/mysql/
Http://www.360sdn.com/opensource-datasource/2015/0530/5972.html
http://mirror.neu.edu.cn/mysql/Downloads/MySQL-5.6/


Some Linux systems do not support the Apt-get command, the yum command installs MySQL only 5.1 version, does not meet the requirements, so can only use the pre-downloaded compressed package to install, and easy to control the version.

2, first use the WINSCP software to copy the above installation files to the designated server, and then into the putty terminal, connected to the server side: (Putty directly placed in the C:\Program Files (x86) \putty directory, through the WINSCP menu shortcut directly access)

3. After entering the system, check if MySQL is installed. Enter the following command:

Rpm-qa | Grep-i MySQL

If the directory is empty, the following actions are ignored. If it is installed, the appropriate version of MySQL will appear, at which point we use the command to delete them:

Rpm-ev mysql-server-5.0.22-0.i386 (yellow part for package name)

In other cases, MySQL was installed by the Yum command, and the Yum command was used to remove it:

Yum Remove Mysql-server mysql-devel (yellow part for package name)
4. Go to the directory where the WINSCP is moved into the archive (MySQL directory): use RPM, command to start the installation of MySQL, first install the service:
RPM-IVH mysql-server-5.5.15-1.linux2.6.x86_64.rpm (The yellow part is the package name, according to your own Baoniding)

If you are prompted for a missing dependent package during installation, you can download it using the Yum command, as follows:

then install the client-side compression package:
RPM-IVH mysql-client-5.5.15-1.linux2.6.x86_64.rpm (yellow part for package name)

then install the MySQL development dependency package:
RPM-IVH mysql-devel-5.5.28-1.rhel5.i386.rpm (yellow part for package name)

The installation is complete at this point.
5, the following configuration
whereis mysql command can query the location of several main MySQL directories:

Then start the MySQL service, enter the following command, and the results below indicate that the service is running correctly:
Service MySQL Start

For ease of operation, we set up MySQL boot from:
Self-booting chkconfig MySQL on

After restarting the server, enter the following command to see if the MySQL service is started in the list of services, as follows 2/3/4/5 on indicates that the service has been started:
Chconfig--list


6, modify the User:
#mysql-U Root
mysql> use MySQL;
mysql> UPDATE user SET Password = Password (' newpassword ') WHERE user = ' root ';
mysql> flush Privileges;

This can be done when the root password is lost
#mysqld_safe--skip-grant-tables&
#mysql-u root mysql
mysql> UPDATE user SET Password=password ("New password") WHERE user= ' root ';
mysql> FLUSH privileges;
or:
/etc/init.d/mysql Stop (service mysqld stop)
/usr/bin/mysqld_safe--skip-grant-tables
also open an SSH connection
[[email protected] ~]# MySQL
mysql>use MySQL
mysql>update User Set Password=password ("123456") where user= "root";
Mysql>flush privileges;
mysql>exit;

Finish

Server database build process (CENTOS+MYSQL)

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.