我正在使用Amazon Linux,并且使用rpm软件包安装了mysql-community-server和mysql-communitu-client。
rpm -ivh mysql-community-common-5.5.62-2.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.5.62-2.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.5.62-2.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.5.62-2.el7.x86_64.rpm
mysql版本
bash-4.2# /usr/bin/mysql --version
/usr/bin/mysql Ver 14.14 Distrib 5.5.62, for Linux (x86_64) using readline 5.1
但是,我无法启动mysql服务器或设置密码。 mysql.sock文件也丢失了。尝试启动mysql服务器时出现以下错误。
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
我按照相同的步骤安装mysql5.1.39
rpm -ivh MySQL-server-5.1.39-0.glibc23.x86_64.rpm
rpm -ivh MySQL-client-5.1.39-0.glibc23.x86_64.rpm
启动mysql服务器'/etc/init.d/mysql start'后无法连接到本地MySQL服务器错误已解决。
但是对于版本mysql 5.5,我无法在其中找到mysql文件 目录/etc/init.d /
我尝试如下启动服务器,并得到另一个错误。
bash-4.2# sudo /usr/sbin/mysqld start
181214 19:35:07 [Note] /usr/sbin/mysqld (mysqld 5.5.62) starting as process 135 ...
181214 19:35:07 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
181214 19:35:07 [ERROR] Aborting
181214 19:35:07 [Note] /usr/sbin/mysqld: Shutdown complete
bash-4.2# sudo systemctl start mysqld
Failed to get D-Bus connection: Operation not permitted
bash-4.2#