Can't connect to local MySQL server through socke in CentOS 7 - mysql

I have a dedicated server with CentOS 7 command line OS, and then I remove MariaDB from it and download MySQL RPM packages(Red Hat Enterprise Linux 7 / Oracle Linux 7 (x86, 64-bit), RPM Bundle 5.7.1 557.1M) and then run rpm -ivh --replacefiles mysql-*.rpm for install that.
after install when I try to check mysql -version I face with this error
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
when I check the mysql datadir path in /var/lib/mysql/, this path haven't any files !!
please help me how I can install and then run MySQL server from rpm packages(offline mode) and then use it in CentOS 7. and How I can fix this problem.
thanks for helps.

Related

How to install mysql shell in centos 7

i'm trying to set up mysql shell in Centos 7 by following the instructions in this document
https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-install-linux-quick.html
i was able to set up the repo for centos 7 but when i try to install, it seems it's installing the mysql-shell for Centos 8 and i'm getting what i believe is a gcc error even if gcc is installed because of it
i then tried installing from their direct downloads page here https://dev.mysql.com/downloads/shell/ by picking Red Hat Enterprise Linux 8 / Oracle Linux 8 (x86, 64-bit), RPM Package and installing yum localinstall but while the installation was successful, the mysql shell still didn't come up
has anyone been able to install mysql shell in centos 7? how did you go about it?
You're using the wrong command for it. Use this instead:
[developer#web01-compute ~]$ mysqlsh
Then once you're in you can type:
\c 127.0.0.1
To connect to any locally running instances of mysql. Or just use the ip address of whatever mysql instance you are trying to connect to. Be prepared to give password for it.
\sql
lets you begin typing normal sql commands.

MySQL.sock doesn't exist | CentOS7 - ERPNext installation

I'm trying to install ERPNext with their install script provided at github (https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh) on my virtual CentOS 7 server. It has MariaDB 10.x installed and I have to remove it first, before I use the script, otherwise I get an error.
But I don't have a solution for following problem, could you guys help me out?
sudo bash setup_frappe.sh --setup-production
Installing for centos 7 amd64
In case you encounter an error, you can post on https://discuss.frappe.io
Adding centos mariadb repo
Installing packages for centos. This might take time...
Installing wkhtmltopdf
Configuring CentOS services
Starting services
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
In Cmd try this:
sudo service mysql stop
sudo service mysql start

Percona 5.6 on amazon linux ami failing

Amazon linux AMI and Percona server 5.6 don't appear to be compatible right out of the box. MySQL won't start after successful install.
In Perconas docs it does say that it is supported.
Steps to get to the below:
yum install http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm
yum install Percona-Server-server-56
Which installs the client + shared 56 libraries as well.
Some more accurate logs.
[root#* ec2-user]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root#* ec2-user]# service mysql restart
ERROR! MySQL (Percona Server) PID file could not be found!
Starting MySQL (Percona Server).......... ERROR! The server quit without updating PID file (/var/lib/mysql/ip-172-30-0-92.pid).
On the most recent Amazon Linux AMI, I was able to start the server after running these commands:
yum install 'perl(Data::Dumper)'
yum reinstall Percona-Server-server-56
If the perl-Data-Dumper package is not installed, mysql_install_db fails to run and perform the initial setup.
The Percona-Server-server-56 package should declare a dependency on perl-Data-Dumper, but you can work around that error (and avoid the reinstall) by installing it first.

Errow When Starting MySQL [UBUNTU 13.04]

I am having troubles starting MySQL Community Server. I am using Ubuntu 13.04. I have downloaded MySQL Community Server 5.6 the Debian package. I don't have any previous MySQL Versions installed.
I installed the package using this command dpkg -i mysql-5.6.14-debian6.0-i686.deb and it was successful.
I found the installation files in /opt/mysql. I opened /opt/mysql/server-5.6/supported-files and then typed: ./mysql.server start.
I got the following error:
The server quit without updating PID file (/opt/mysql/server-5.6/data/ubuntu.pid)
How can I solve that problem?
Thank You.

Centos 5.5 - upgrade Mysql to 5.1 and get it working

I am not a server administrator but hope that one can help me. Thanks!
I have a fresh CentOS 5.5 with VirtualMin installed.
I get this when starting MySQL:
Failed to start database :
sh: /etc/rc.d/init.d/mysqld: No such file or directory
IN ADDITION, I wish to upgrade from 5.0 mysql to 5.1 mysql. I have already used this command:
rpm -Uvh MySQL-shared-community-5.1.56-1.rhel5.i386.rpm
But in Webmin my MySQL version still shows up as mysql 5.0.77-4.el5_5.4, rather than upgrade 5.0 rpm just installs 5.1 along side it.
How do I upgrade to 5.1 and configure it to work? Thanks much.
If you already have mysql installed, try the "--replacepkgs" argument together with the "rpm" command.
Regarding sh: /etc/rc.d/init.d/mysqld: No such file or directory, it should be fixed once you install the newer mysql successfully.