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
You need to install the server package:
sudo yum install mysql-server
After installation, you have to start the service:
sudo service mysqld start
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.