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
Make sure you have privileges to access the /var/lib/mysql/mysql.sock file. And if you still get the error, create a default my.cnf file with
[client]
socket = /path/to/mysql/data/mysql.sock
[mysqld]
server-id = 2
socket = /path/to/mysql/data/mysql.sock
port = 4000 #any port you wish
basedir = /path/to/mysql
datadir = /path/to/mysql/data
and initialize the database again. Make sure you give --defaults-file=/path/to/mysql/my.cnf
when you initialize. If you get error saying files exist in /path/to/mysql/data
, remove them and try again. Once done, when you run mysql also, give --defaults-file=/path/to/mysql/my.cnf
.
Should work.