I\'m trying to access mysql and when I run the mysql command, I get the following.
[root@ip-10-229-65-166 tpdatabase-1.8.0.28356]# mysql
ERR
rm -rvf /var/lib/mysql/ib_logfile*
touch /var/lib/mysql/mysql.sock
touch /var/lib/mysql/mysql.pid
chown -R mysql:mysql /var/lib/mysql
systemctl restart mysql
try this and check the permission of both /var/lib/mysql/mysql.sock and /tmp
just search for mysqld, this is the server daemon:
find / | grep mysqld
If you found it, the server package may be correctly installed but without initd scripts. For testing, you may start the mysql server by hand executing the above file.
Before hitting mysql on command prompt make sure your correct my.cnf configuration file
is in placed and set the permission of etc folder as
chmod -R 777
etc folder as below list to avoid
error MySQL - ERROR 2002 (HY000): e.g /etc/my.cnf, /etc/mysql/my.cnf, $MYSQL_HOME/my.cnf [datadir]/my.cnf ~/.my.cnf
I recently encountered this problem after an upgrade on Ubuntu 18.04. The solution here solved it https://serverfault.com/a/957723/439448.
We faced a similar problem in my office setup with the same OS. The actual thing that was happening was low space on the server. It is quite strange, but i believe if the server gets full the files cannot be loaded or of some other resort. Please check to be sure the space on the server is enough else you have to try removing the installed mysql and reinstall. Best of luck.
mysql might have been packaged separately as client and server. Check your package repositories to make sure that the server has been installed. The mysql
package might only be the client. Check if there's a package called mysql-server
or something similar. Check the list of files installed by the mysql
package to see if it actually installs the server.
If the files are not even there, it's not a permissions problem. Also, you're running as root.