centos start mysql error mysqld: unrecognized service

1. mysql installed before clean up

rpm -qa | grep mysql
mysql-libs-5.1.52-1.el6_0.1.x86_64
yum remove mysql-libs-5.1.52-1.el6_0.1.x86_64
rm -fr /var/lib/mysql/*
rm /var/lock/subsys/mysqld
killall mysqld

  

2.yum source installation MYSQL

wget https://repo.mysql.com//mysql80-community-release-el6-1.noarch.rpm
rpm -ivh mysql80-community-release-el6-1.noarch.rpm
yum clean all
yum makecache
yum install mysql-community-server

3. Start MySQL

/etc/init.d/mysqld start

4. If you start successfully ignore, if you start mysql error mysqld: unrecognized service

Probably did not install mysql-server

rpm -q mysql

Installation of the server side mysql

yum install mysql-server

Then enter /etc/init.d/mysqld start a successful start

 5. Before login first find the default login password

grep "password" /var/log/mysqld.log

6. Log 

 mysql -u root -p

  Then enter the default login password

7. Modify password must be complex, simple passwords are not changed successfully

ALTER USER 'root'@'localhost' IDENTIFIED BY '密码';

  

 

 

navicat connect to MySQL server on the cloud Ali

Authorization:

ALL the GRANT PRIVILEGES . * * The ON the TO 'the root' @ '%' the IDENTIFIED BY 'database password' the WITH the GRANT the OPTION;

Refresh permissions:

FLUSH PRIVILEGES;

 

Set security set of rules:

 (Think pictures look clear, Ctrl + mouse scroll)

Guess you like

Origin www.cnblogs.com/Alwaysbecoding/p/11294257.html