The IP address has been modified over, with the host in a network segment (bridge mode). However, MySQL cannot connect.
[[email protected] ~]# MySQL
ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)
[Email protected] ~]# Ps-a | Grep-i MySQL
[[Email protected] ~]# service MySQL start
Redirecting To/bin/systemctl start Mysql.service
Failed to start mysql.service:Unit not found.
[[email protected] ~]# ps-ef|grep MySQL
Root 4560 4126 0 20:40 pts/0 00:00:00 grep--color=auto MySQL
[[email protected] ~]#/etc/init.d/mysql start
BASH:/etc/init.d/mysql: no file or directory
There is no mysqld in/etc/rc.d/init.d,
[Email protected] ~]#/usr/bin/mysqladmin version
/usr/bin/mysqladmin:connect to server at ' localhost ' failed
Error: ' Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2) '
Check that Mysqld was running and that the socket: '/var/lib/mysql/mysql.sock ' exists!
[Email protected] ~]# Rpm-qa | Grep-i MySQL
Qt5-qtbase-mysql-5.6.1-10.el7.x86_64
Qt3-mysql-3.3.8b-51.el7.x86_64
Akonadi-mysql-1.9.2-4.el7.x86_64
Perl-dbd-mysql-4.023-5.el7.x86_64
Qt-mysql-4.8.5-13.el7.x86_64
Mysql-python-1.2.5-1.el7.x86_64
[[email protected] ~]# Whereis MySQL
MySQL:/usr/bin/mysql/usr/lib/mysql/usr/lib64/mysql/usr/include/mysql/usr/share/mysql/usr/share/man/man1/ Mysql.1.gz
[Email protected] ~]# Find/-name Mysql.sock
[Email protected] ~]# Touch/var/lib/mysql/mysql.sock
[[email protected] ~]# service MySQL start
Redirecting To/bin/systemctl start Mysql.service
Failed to start mysql.service:Unit not found.
[Email protected] ~]# systemctl start Mysql.service
Failed to start mysql.service:Unit not found. [[Email protected] ~]# service mysqld status
Redirecting To/bin/systemctl status Mysqld.service
Unit Mysqld.service could not being found.
[[Email protected] ~]# service mysqld stop
Redirecting To/bin/systemctl Stop Mysqld.service
Failed to stop Mysqld.service:Unit mysqld.service not loaded.
[Email protected] ~]# rm-fr/var/lib/mysql/*
[Email protected] ~]# Rm/var/lock/subsys/mysqld
RM: Unable to delete "/var/lock/subsys/mysqld": No file or directory
[Email protected] ~]# Killall mysqld
Mysqld:no Process found
[[Email protected] ~]# service MySQL start
Redirecting To/bin/systemctl start Mysql.service
Failed to start mysql.service:Unit not found.
Read a lot of posts, the actual is not the problem. Finally this post solved, the foreigner met. Or foreign posts are valuable, more content, more original. Google is important.
Http://www.cnblogs.com/aleafo/p/4946037.html
# mysql-u root-penter Password:Welcome to the MariaDB Monitor. Commands End With; MariaDB Connection ID is 11Server version:5.5.37-mariadb MariaDB servercopyright (c) \g.your, Oracle, Monty Program Ab and others. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement. MariaDB [(None)]>
So the 3 steps to enable and run MariaDB is as follows, assuming it was previously installed during the initial setup for The system or with yum install mariadb mariadb-server
:
Systemctl Start Mariadb.service
Systemctl Enable Mariadb.service
Mysql_secure_installation
After VMware loads the virtual machine on the other host, MySQL cannot boot. How to solve?