CentOS installs MySQL process and resolves startup failure issues

Source: Internet
Author: User
Tags import database

Installation steps

Before installing, we can detect whether the system comes with MySQL installed:

rpm -qa | grep mysql

If you have a system installed, you can choose to uninstall:

rpm -e mysql  // 普通删除模式rpm -e --nodeps mysql 

Installation

    wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm    rpm -ivh mysql57-community-release-el7-9.noarch.rpm    yum install mysql-server

Initialize MySQL:

mysqld --initialize

Start MySQL:

    systemctl start mysqld

To view MySQL running status:

    systemctl status mysqld
CentOS Start MySQL Error
$ systemctl status mysqld.service● mysqld.service - MySQL Server  Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: activating (start-pre) since 一 2018-09-03 06:27:17 EDT; 631ms ago   Docs: man:mysqld(8)         http://dev.mysql.com/doc/refman/en/using-systemd.htmlProcess: 26472 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)Control: 26489 (mysqld_pre_syst) Memory: 26.6M CGroup: /system.slice/mysqld.service       └─control         ├─26489 /bin/bash /usr/bin/mysqld_pre_systemd         └─26506 /usr/bin/python -Es /usr/sbin/semanage fcontext -a -e /var/lib/mysql /var/lib/mysql-files

September 06:27:17 TEST241VM22 systemd[1]: Starting MySQL Server ...

Solutions
chown mysql:mysql -R /var/lib/mysql
Modify the initial password
     You must reset your password using ALTER USER statement before executing this statement.

After the installation of MySQL, after landing, regardless of running any command, always prompt this

Step 1:set PASSWORD = PASSWORD (' Your new PASSWORD ');

Step 2:alter USER ' root ' @ ' localhost ' PASSWORD EXPIRE never;

Step 3:flush privileges;

Create user, authorize remote login
create user ‘test‘@‘10.1.3.200‘ identified by ‘123456‘;grant all privileges on *.* to ‘sl_test‘@‘10.100.0.0‘;    flush privileges;
Import Database
source /data/model/tables.sql       

CentOS installs MySQL process and resolves startup failure issues

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.