0
votes

I am a beginner to programming world: Been googling and trying many things for two days... but no solution. Installed cptserver for LAMP, for virtual machine (Git, vagrant, puppet): https://github.com/pigeontech/cptserver

When I try to start Mysql, I get the following errors:

vagrant@localhost:~$ /usr/bin/mysqld_safe &

[1] 3404 vagrant@localhost:~$ 160311 01:02:50 mysqld_safe Can't log to error log and syslog at the same time.

Remove all --log-error configuration options for --syslog to take effect.

160311 01:02:50 mysqld_safe Logging to '/var/log/mysql/error.log'.

touch: cannot touch ‘/var/log/mysql/error.log’: Permission denied

chmod: cannot access ‘/var/log/mysql/error.log’: Permission denied

cat: /var/run/mysqld/mysqld.pid: Permission denied

rm: cannot remove ‘/var/run/mysqld/mysqld.pid’: Permission denied

160311 01:02:50 mysqld_safe Fatal error: Can't remove the pid file: /var/run/mysqld/mysqld.pid

Please remove it manually and start /usr/bin/mysqld_safe again; mysqld daemon not started

/usr/bin/mysqld_safe: 126: /usr/bin/mysqld_safe: cannot create /var/log/mysql/error.log: Permission denied

vagrant@localhost:~$ [1]+ Exit 1
/usr/bin/mysqld_safe

Can some one show me a solution in simple way?

1

1 Answers

0
votes

At last, I could resolve it by the following steps:

$ sudo mysql_install_db

/usr/bin/mysql_secure_installation

$ sudo /usr/bin/mysqld_safe &

Opened a new window (Alt + F2) and brought the cursor to vagrant@localhost:~$

Then, opened MySQL by:

$ sudo /usr/bin/mysql -u root -p mysql